bug fix & typo fix

This commit is contained in:
sevin7676 2015-04-19 08:18:04 -04:00
commit ee90854917
2 changed files with 16 additions and 9 deletions

View file

@ -1,9 +1,9 @@
-- =============================================
-- Author: Morgan Yarbrough
-- Create date: 4/27/2015
-- Description: Test Procedure that shows off language features.
-- Includes non-standard folding using region comments using either
-- line comments or block comments (both are demonstrated below)
-- Description: Test procedure that shows off language features.
-- Includes non-standard folding with region comments using either
-- line comments or block comments (both are demonstrated below).
-- This mode imitates SSMS and it designed to be used with SQL Server theme.
-- =============================================
CREATE PROCEDURE dbo.TestProcedure
@ -11,7 +11,7 @@ CREATE PROCEDURE dbo.TestProcedure
--#region parameters
@vint INT = 1
,@vdate DATE = NULL
,@vdatetime DATETIME = DATEADD (dd, 1, GETDATE())
,@vdatetime DATETIME = DATEADD(dd, 1, GETDATE())
,@vvarchar VARCHAR(MAX) = ''
--#endregion
@ -38,8 +38,8 @@ BEGIN
-- another folding demonstration
IF @vint = 1
BEGIN
SET @vvarchar='one'
SET @vint = DATEDIFFT(dd, @vdate, @vdatetime)
SET @vvarchar = 'one'
SET @vint = DATEDIFF(dd, @vdate, @vdatetime)
END
-- this mode handles strings properly
@ -47,7 +47,7 @@ BEGIN
FROM Orders
WHERE @OrderDate > GETDATE()'
-- this mode is aware of build in stored procedures
-- this mode is aware of built in stored procedures
EXECUTE sp_executesql @sql
-- demonstrating some syntax highlighting
@ -60,4 +60,9 @@ BEGIN
WHERE CompanyName NOT LIKE '%something'
OR CompanyName IS NULL
OR CompanyName IN ('bla', 'nothing')
-- this mode includes snippets
-- place your cusor at the end of the line below and trigger auto complete (Ctrl+Space)
createpr
END

View file

@ -121,10 +121,12 @@ var SqlServerHighlightRules = function() {
// createKeywordMapper ignores case which we want because SqlServer keywords are not case sensitive which causes our keywords to get changed to lowercase.
// However, the preferred standard for keywords is uppercase, so this transforms them back to uppercase for code completion
// EXCEPTION: build in stored procedures are lower case
// EXCEPTION: built in stored procedures are lower case
builtInStoredProcedures = builtInStoredProcedures.split('|');
for (var i = 0; i < this.$keywordList.length; i++) {
var keyword = this.$keywordList[i];
if (builtInStoredProcedures.indexOf(keyword) !== -1) continue;
this.$keywordList[i] = keyword.toUpperCase();
}
@ -171,7 +173,7 @@ var SqlServerHighlightRules = function() {
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token: keywordMapper,
regex: "@{0,2}[a-zA-Z_$][a-zA-Z0-9_$]*\\b" //up to 2 @symbols for some build in functions
regex: "@{0,2}[a-zA-Z_$][a-zA-Z0-9_$]*\\b" //up to 2 @symbols for some built in functions
}, {
token: "constant.class",
regex: "@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b"