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 -- Author: Morgan Yarbrough
-- Create date: 4/27/2015 -- Create date: 4/27/2015
-- Description: Test Procedure that shows off language features. -- Description: Test procedure that shows off language features.
-- Includes non-standard folding using region comments using either -- Includes non-standard folding with region comments using either
-- line comments or block comments (both are demonstrated below) -- line comments or block comments (both are demonstrated below).
-- This mode imitates SSMS and it designed to be used with SQL Server theme. -- This mode imitates SSMS and it designed to be used with SQL Server theme.
-- ============================================= -- =============================================
CREATE PROCEDURE dbo.TestProcedure CREATE PROCEDURE dbo.TestProcedure
@ -39,7 +39,7 @@ BEGIN
IF @vint = 1 IF @vint = 1
BEGIN BEGIN
SET @vvarchar = 'one' SET @vvarchar = 'one'
SET @vint = DATEDIFFT(dd, @vdate, @vdatetime) SET @vint = DATEDIFF(dd, @vdate, @vdatetime)
END END
-- this mode handles strings properly -- this mode handles strings properly
@ -47,7 +47,7 @@ BEGIN
FROM Orders FROM Orders
WHERE @OrderDate > GETDATE()' 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 EXECUTE sp_executesql @sql
-- demonstrating some syntax highlighting -- demonstrating some syntax highlighting
@ -60,4 +60,9 @@ BEGIN
WHERE CompanyName NOT LIKE '%something' WHERE CompanyName NOT LIKE '%something'
OR CompanyName IS NULL OR CompanyName IS NULL
OR CompanyName IN ('bla', 'nothing') 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 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. // 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 // 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++) { for (var i = 0; i < this.$keywordList.length; i++) {
var keyword = this.$keywordList[i]; var keyword = this.$keywordList[i];
if (builtInStoredProcedures.indexOf(keyword) !== -1) continue; if (builtInStoredProcedures.indexOf(keyword) !== -1) continue;
this.$keywordList[i] = keyword.toUpperCase(); this.$keywordList[i] = keyword.toUpperCase();
} }
@ -171,7 +173,7 @@ var SqlServerHighlightRules = function() {
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, { }, {
token: keywordMapper, 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", token: "constant.class",
regex: "@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex: "@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b"