mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Update Keywords list to include most tokens (#244)
- Fixes https://github.com/Microsoft/vscode-mssql/issues/705 - Updated the keyword list to include most common keyword ranges and added test to cover top 10 missing keywords - Fixed a bug in TestUtilities.cs where text range was not defined correctly.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
-- Case: common type keywords
|
||||
|
||||
create table [SimpleTable]
|
||||
(
|
||||
|
||||
-- this is a comment before document
|
||||
[DocumentID] INT identity (1, 1) not null,
|
||||
|
||||
-- this is a comment before Title
|
||||
[Title] NVARCHAR (50) not null,
|
||||
|
||||
|
||||
-- this is a comment before FileName
|
||||
[FileName] NVARCHAR (400) not null,
|
||||
|
||||
-- this is a comment before FileExtension
|
||||
[FileExtension] nvarchar(8)
|
||||
);
|
||||
go
|
||||
create view v1
|
||||
as
|
||||
select *
|
||||
from [SimpleTable]
|
||||
go
|
||||
create procedure p1
|
||||
as
|
||||
begin
|
||||
select *
|
||||
from [SimpleTable]
|
||||
end
|
||||
go
|
||||
insert into t
|
||||
default values
|
||||
go
|
||||
|
||||
go
|
||||
insert openquery (OracleSvr, 'SELECT name FROM joe.titles')
|
||||
values
|
||||
('NewTitle');
|
||||
go
|
||||
insert into myTable
|
||||
(FileName, FileType, Document)
|
||||
select 'Text1.txt' as FileName,
|
||||
'.txt' as FileType,
|
||||
*
|
||||
from openrowset(bulk N'C:\Text1.txt', siNGLE_BLOB) as Document;
|
||||
go
|
||||
select *
|
||||
from openxml (@idoc, '/ROOT/Customers')
|
||||
exec sp_xml_removedocument @idoc;
|
||||
@@ -0,0 +1,50 @@
|
||||
-- Case: common type keywords
|
||||
|
||||
CREATE TABLE [SimpleTable]
|
||||
(
|
||||
|
||||
-- this is a comment before document
|
||||
[DocumentID] INT IDENTITY (1, 1) NOT NULL,
|
||||
|
||||
-- this is a comment before Title
|
||||
[Title] NVARCHAR (50) NOT NULL,
|
||||
|
||||
|
||||
-- this is a comment before FileName
|
||||
[FileName] NVARCHAR (400) NOT NULL,
|
||||
|
||||
-- this is a comment before FileExtension
|
||||
[FileExtension] nvarchar(8)
|
||||
);
|
||||
GO
|
||||
CREATE VIEW v1
|
||||
AS
|
||||
SELECT *
|
||||
FROM [SimpleTable]
|
||||
GO
|
||||
CREATE PROCEDURE p1
|
||||
AS
|
||||
BEGIN
|
||||
SELECT *
|
||||
FROM [SimpleTable]
|
||||
END
|
||||
GO
|
||||
INSERT INTO t
|
||||
DEFAULT VALUES
|
||||
GO
|
||||
|
||||
GO
|
||||
INSERT OPENQUERY (OracleSvr, 'SELECT name FROM joe.titles')
|
||||
VALUES
|
||||
('NewTitle');
|
||||
GO
|
||||
INSERT INTO myTable
|
||||
(FileName, FileType, Document)
|
||||
SELECT 'Text1.txt' AS FileName,
|
||||
'.txt' AS FileType,
|
||||
*
|
||||
FROM OPENROWSET(BULK N'C:\Text1.txt', siNGLE_BLOB) AS Document;
|
||||
GO
|
||||
SELECT *
|
||||
FROM OPENXML (@idoc, '/ROOT/Customers')
|
||||
EXEC sp_xml_removedocument @idoc;
|
||||
@@ -0,0 +1,41 @@
|
||||
-- Case: common type keywords
|
||||
|
||||
cReaTe tAbLe [SimpleTable]
|
||||
(
|
||||
|
||||
-- this is a comment before document
|
||||
[DocumentID] INT iDentIty (1, 1) NOT NULL,
|
||||
|
||||
-- this is a comment before Title
|
||||
[Title] NVARCHAR (50) NOT NULL,
|
||||
|
||||
|
||||
-- this is a comment before FileName
|
||||
[FileName] NVARCHAR (400) NOT NULL,
|
||||
|
||||
-- this is a comment before FileExtension
|
||||
[FileExtension] nvarchar(8)
|
||||
);
|
||||
GO
|
||||
CREATE vIEw v1 aS select * from [SimpleTable]
|
||||
GO
|
||||
CREATE pRoceduRe p1 aS
|
||||
bEgIn
|
||||
select * from [SimpleTable]
|
||||
eNd
|
||||
GO
|
||||
iNsert iNto t dEfault vAlues
|
||||
GO
|
||||
|
||||
GO
|
||||
iNsert oPenQUERY (OracleSvr, 'SELECT name FROM joe.titles')
|
||||
VALUES ('NewTitle');
|
||||
GO
|
||||
INSERT INTO myTable(FileName, FileType, Document)
|
||||
SELECT 'Text1.txt' AS FileName,
|
||||
'.txt' AS FileType,
|
||||
* FROM openROWSET(bUlK N'C:\Text1.txt', siNGLE_BLOB) AS Document;
|
||||
GO
|
||||
sELECT *
|
||||
FROM openXML (@idoc, '/ROOT/Customers')
|
||||
exEC sp_xml_removedocument @idoc;
|
||||
Reference in New Issue
Block a user