コード例 #1
0
        public void TestMethod()
        {
            // Arrange
            var engine = new FormattingEngine();
            var sut = new ParamBuilderFormatter(engine);

            // Act
            string result = sut.Execute(sample);

            // Assert
            Assert.AreEqual(expected, result);
        }
コード例 #2
0
ファイル: SqlFormatter.cs プロジェクト: mecurioJ/sqlformat
        // Experimental (not working!)
        //private static int GetStartIndent( TextDocument textDocument )
        //{
        //    var text = textDocument.Selection.Text;
        //    int index = 0;
        //    while ( ( text[ index ] == ' ' ) && ( text[ index ] != '\n' ) )
        //        index++;
        //    return index + textDocument.Selection.AnchorColumn;
        //}
        public SqlFormatter(AddIn addIn)
            : base(addIn)
        {
            _engine = new FormattingEngine();
            _engine.IndentStep = 0; // experimental: GetStartIndent( textDocument ) / engine.TabSize;

            KeyName = "LaanSqlFormat";
            DisplayName = "Format SQL";
            DescriptivePhrase = "Formatting SQL";

            ButtonText = "Format S&QL";
            ToolTip = "Formats the current file";
            ImageIndex = 59;
            KeyboardBinding = "Text Editor::Ctrl+`";
        }