Commit Graph

37 Commits

Author SHA1 Message Date
Aasim Khan
3b60f4b089 Fixing a null exception error when bound tables are null. (#1327)
* Fixing a null exception error when bound tables are null.

* skipping star expansion when there is no active conn

* Fixing a comment
2021-12-02 14:15:26 -08:00
Aasim Khan
e246bc5325 Adding star expression expansion (#1270) 2021-10-27 16:59:05 -07:00
Soheil Alizadeh
887a499d2b Update Infrastructure (#961)
* Update form .NET Core 2.2 to .NET Core 3.1

- Global variable for projects
- Change TFMs from netcoreapp2.2 to netcoreapp3.1
- Update global.json
- Update build.json
- Remove direct framework cake TestCore task
- Update travis dotnet version
- Update azure pipline file
- Update vscode launch.json

* Add Central Package Management

* Fix xUnit Breaking Change for MemberData type

* Fix xUnit breaking change for duplicate test method name

* Fix Rang/Index type conflict with System.Rang/Index

* Update vscode tasks.json

* Change serviceHostExecutable path in ServiceTestDriver.cs

* Downgrade SDK version (https://github.com/appveyor/ci/issues/3440)

- Appveyor hasn't installed latest SDK therefore I downgrade it until they install it.

* Dump Microsoft.SqlServer.DACFx
2020-06-12 11:44:18 -07:00
Satyem-MS
8d6a48a23f Auto Completion for date_bucket (#933) 2020-05-18 11:27:11 -07:00
Charles Gagnon
314d01739d Fix auto-complete inserting brackets around function names (#895)
* Fix reserved words not to be bracket quoted

* wip

* More fixes

* Better name

* Format files and update test
2019-11-26 17:16:05 -08:00
Shengyu Fu
b01bdeba32 Adding more tsql keywords and functions for completion (#851) 2019-08-19 09:00:24 -07:00
Shengyu Fu
e1b9890f5c Adding completion extension loading and execution logic (#833)
* Adding ICompletionExtension interface

* Adding extension loading and execution logic

* Fixing compilation error in VS 2017

* Using MEF for completion extension discovery

* using await on GetCompletionItems

* Adding an integration test for completion extension and update the completion extension interface

* Update the completion extension test

* Fix issues based on review comments

* Remove try/cache based on review comments, fix a integration test.

* More changes based on review comments

* Fixing SendResult logic for completion extension loading

* Only load completion extension from the assembly passed in, add more comments in the test

* Adding right assert messages in the test.

* More fixes based on review comments

* Dropping ICompletionExtensionProvider, load assembly only if it's loaded at the first time or updated since last load.

* Fix based on the latest review comments

* Adding missing TSQL functions in default completion list

* Update jsonrpc documentation for completion/extLoad
2019-07-19 12:04:03 -07:00
Karl Burtram
5cfb4fa9dc Add between to keyword completion list (#618) 2018-05-15 12:06:11 -07:00
Karl Burtram
aacb435cba Add 'UPDATE' to default intellisense keywords list (#602) 2018-04-16 15:33:59 -07:00
Kevin Cunnane
869cd1439f Add LanguageFlavorNotification handling and refactor LanguageService (#375)
* Add LanguageFlavorNotification handling and refactor LanguageService
- Added new notification handler for language flavor changed
- Refactored the LanguageService so that it no longer relies on so many intertwined static calls, which meant it was impossible to test without modifying the static instance. This will help with test reliability in the future, and prep for replacing the instance with a service provider.

* Skip if not an MSSQL doc and add test

* Handle definition requests

* Fix diagnostics handling
2017-06-12 13:28:24 -07:00
Kevin Cunnane
a4c630d5d3 Avoid throwing exception in LangageService for OE connections (#361)
* Ensure connection open for OE queries and fix connection disposal
- Dispose connection in Metadata service, to ensure we cleanly dispose and don't rely on garbage colleciton
- Fixed issue where if the connection was closed, expanding databases in the Server would fail. This is because SMO doesn't always reopen the connection, certainly not for Server level queries. The solution is to always check if open and reopen.
- Added unit tests for this, which required mocking the relevant IsOpen / OpenConnection methods. Refactored SMO wrapper calls into a dedicated class file to handle this

* Avoid throwing exception in LangageService for OE connections
- Handle non-File URIs by skipping language service binding in those cases. Added test for this

- VSCode passes untitled:, git: and other paths, often without a '/'. Updated logic to handle this.

* Handle windows file paths
2017-05-26 13:11:26 -07:00
Karl Burtram
b26b7674b3 Add EXCEPT to default keyword completion list (#349) 2017-05-12 22:54:55 -07:00
Karl Burtram
8f3e83b519 Add nvarchar to IntelliSense keyword list (#272) 2017-03-09 14:33:43 -08:00
Karl Burtram
f00136cffb Fix namespaces for code moved to separate class libraries (#263)
* Create ServiceHost a service-specific class

* Renaming hosting namespace

* Rename credentials namespace

* Fix namespaces
2017-03-02 14:41:06 -08:00
Aditya Bist
cde7bd49b3 added tests for new scenario 2016-12-19 10:53:20 -08:00
Aditya Bist
ac28d3b78f fixed changes according to review 2016-12-15 13:59:34 -08:00
Aditya Bist
6e746efad0 reserved words with brackets in autocomplete 2016-12-15 11:12:36 -08:00
Leila Lali
0b295e78c2 adding a new event for when definition is requested (#167)
* sending telemetry events for intellisense usage
2016-12-08 14:05:42 -08:00
Leila Lali
379c6170b3 Intellisense for when the text starts with bracket (#164)
* Intellisense for when the text starts with bracket
2016-12-06 10:09:50 -08:00
Mitchell Sternke
c95933b7e1 Implemented function signature help, and added tests (#153)
* Implemented function signature help, and added tests

* Incremental commit of changes from code review feedback

* Rename test

* Added check to make sure intellisense is enabled

* Use HoverTimeout instead of BindingTimeout
2016-11-30 14:22:48 -08:00
Karl Burtram
39b79ae05b Merge branch 'master' into dev 2016-11-28 09:58:32 -08:00
Mitchell Sternke
ba0f564126 Fixed Turkish I problem with autocomplete keyword suggestions (#158) 2016-11-22 17:05:03 -08:00
Karl Burtram
8e83afd628 Fix merge build break 2016-11-06 21:05:24 -08:00
Karl Burtram
cd5abad0f2 Merge branch 'release/ctp10' 2016-11-06 20:45:48 -08:00
Karl Burtram
ea77bfa885 Suggestion list cleanups (#115)
* Add additional autocomplete words

* Add another word to default completion list

* Add colorization keywords and fix minor bugs.
2016-10-25 12:08:41 -07:00
Karl Burtram
649ea7d05c Suggestion list cleanups (#115)
* Add additional autocomplete words

* Add another word to default completion list

* Add colorization keywords and fix minor bugs.
2016-10-25 17:21:37 +00:00
Karl Burtram
1d7e6e353f Feature/cleanups1 (#114)
* Intellisense cleanups.

* Additional intellisense cleanups for default list

* Add missing Monitor.Exit in completion resolve

* A couple more cleanups.

* Bug fixes for auto-complete.

* Add comment regarding conditional logic
2016-10-24 18:11:49 +00:00
Leila Lali
5a7b412c38 changed the icons for the completion list based on the sql type (#112)
* changed the icons for the completion list based on the sql type
2016-10-21 15:50:12 -07:00
Leila Lali
b3d793dc85 Fixed autocomplete bugs (#110)
Autocomplete for items with special characters doesn't add [ ]
Autocomplete default list shows when it shouldn't..like in comments or literals
2016-10-21 15:03:48 -07:00
Karl Burtram
c5f44ccee1 Switch from events to locks during parsing (#87)
* Switch from event to locks in binding.

* Remove unneeded null check.
2016-10-12 15:09:24 -07:00
Karl Burtram
52b5f222db Merge dev to master for 0.0.7 release (#86)
* Disable failing test while investigating

* Made connection errors more user-friendly (#57)

* Bug/negativeOneRowsAffected strings file fix (#61)

* Adding changes to sr.strings files

* Fixing bug by changing valid filename check to fail on whitespace (#55)

Fixing a bug from the unit tests on OSX/Unix where attempting to create a file with a name that's all whitespace succeeds when it should fail. This was passing in Windows because File.Open throws an ArgumentException when an all whitespace name is provided. In Unix systems, File.Open does not throw, causing the test to fail.

Solution is to check for whitespace in the sanity check.

* Format Cell Values (#62)

* WIP for ability to localize cell values

* Changing how DateTimeOffsets are stored, getting unit tests going

* Reworking BufferFileStreamWriter to use dictionary approach

* Plumbing the DbCellValue type the rest of the way through

* Removing unused components to simplify contract

* Cleanup and making sure byte[] appears in parity with SSMS

* CR comments, small tweaks for optimizing LINQ

* Feature/batch line info (#56)

* inital pipe of line numbers and getting text from workspace services

* tests compile

* Fixed bug regarding tests using connections on mac

* updated tests

* fixed workspace service and fixed tests

* integrated feedback

* Remove deleted file with whitespace name

* Feature/autocomp options (#63)

* Enable IntelliSense settings

* Fix up some bugs in the IntelliSense settings.

* Code cleans for PR

* Fix a couple exceptions that are breaks query execute and intellisense.

* Add useLowerCase flag and settings tests

* Remove task.wait from test to avoid break on build machine. (#67)

This is to fix test breaks so I'll merge now.  Please let me know if there are comments on this commit.

* Do not use ReliableCommand in the query execution service (#66)

* Do not use ReliableCommand in the query execution service.

* Fixing the logic to remove InfoMessage handlers from ReliableSqlConnection

* Adding test to query UDT

* Bump SMO to 140.1.6 to pick up perf fixes (#69)

* Enable Quick Info hover tooltips (#65)

Pushing to include in tomorrow's partner release build.  Please send me any feedback and I'll address in the next Intellisense PR.

* Added grouping between system/user dbs when listing (#70)

* Feature/timestamp messages (#68)

* added support for timestamps

* fixed tests

* Moved message class to own file; added 'z' to end of date strings

* added default time constructor

* removed unnecessary z

* added time string format info in comment

* changed from utc time to using local time

* Feature/save selection (#64)

* Save selection

* Add tests

* Change filename in test

* Code cleanup

* Refactor handler

* Code cleanup

* Modify tests to have query selection

* Change variable declaration

* Bump SMO to 14.0.7 to pick Batchparser updates (#72)

...bumping versions.  No review needed.

* Lingering File Handles (#71)

Fixing a bug where in various situations, the files used for temporary storage of query results would be leftover. In particular, the following changes were made:
* When the dispose query request is submitted, the corresponding query is now disposed in addition from being removed from the list of active queries
* When a query is cancelled, it is disposed after it is cancelled
* If a query already exists for a given ownerURI, the existing query is disposed before creating a new query
* All queries are disposed when the query execution service is disposed (ie, at shutdown of the service)

A unit test to verify the action of the dispose method for a ResultSet was added.

* Ensuring queries are disposed

Adding logic to dispose any queries when:
* URI that already has a query executes another query
* A request to dispose a query is submitted
* A request to cancel a query is submitted

* Small tweaks for cleanup of query execution service

* Add IntelliSense binding queue (#73)

* Initial code for binding queue

* Fix-up some of the timeout wait code

* Add some initial test code

* Add missing test file

* Update the binding queue tests

* Add more test coverage and refactor a bit.  Disable reliabile connection until we can fix it..it's holding an open data reader connection.

* A few more test updates

* Initial integrate queue with language service.

* Hook up the connected binding queue into al binding calls.

* Cleanup comments and remove dead code

* More missing comments

* Fix build break.  Reenable ReliabileConnection.

* Revert all changes to SqlConnectionFactory

* Resolve merge conflicts

* Cleanup some more of the timeouts and sync code

* Address code review feedback

* Address more code review feedback

* Feature/connect cancel (#74)

* Implemented connection cancellation

* Made connect requests return immediately and created a separate connection complete notification

* Fix spelling

* Fix sorting

* Add separate lock for cancellation source map

* Fix an issue with queue deadlocks causing test failures (#77)

* Fixed issue where connecting could take very long and cancellation would not work (#78)

* Fixed issue where connecting could take very long and cancellation would not work

* Addressing feedback

* Remove warning suppression

* Adding unlimited timeout for query execution (#76)

Adding explicitly setting the timeout for command execution to unlimited. We can change this to be user configurable at a later time

* Support 'for XML and for JSON' queries (#75)

* Set isXMl and isJson for 'for xml/json' resultSets

* Change string comparison

* Modify if-else

* VSTS 8499785. Close SqlToolsService after VS Code exits. (#80)

VSTS 8499785. Close SqlToolsService after VS Code exits.

* Remove extra level of tasks in binding queue (#79)

* Remove extra layer of tasks in binding queue

* Change order of assigning result to avoid race condition

* Add timeout log for the metadata lock event

* Fix test cases
2016-10-08 19:18:26 +00:00
Karl Burtram
f32b0290bb Remove extra level of tasks in binding queue (#79)
* Remove extra layer of tasks in binding queue

* Change order of assigning result to avoid race condition

* Add timeout log for the metadata lock event

* Fix test cases
2016-10-08 00:06:35 +00:00
Karl Burtram
62525b9c98 Add IntelliSense binding queue (#73)
* Initial code for binding queue

* Fix-up some of the timeout wait code

* Add some initial test code

* Add missing test file

* Update the binding queue tests

* Add more test coverage and refactor a bit.  Disable reliabile connection until we can fix it..it's holding an open data reader connection.

* A few more test updates

* Initial integrate queue with language service.

* Hook up the connected binding queue into al binding calls.

* Cleanup comments and remove dead code

* More missing comments

* Fix build break.  Reenable ReliabileConnection.

* Revert all changes to SqlConnectionFactory

* Resolve merge conflicts

* Cleanup some more of the timeouts and sync code

* Address code review feedback

* Address more code review feedback
2016-10-04 14:55:59 -07:00
Karl Burtram
806220c4b5 Feature/autocomp options (#63)
* Enable IntelliSense settings

* Fix up some bugs in the IntelliSense settings.

* Code cleans for PR

* Fix a couple exceptions that are breaks query execute and intellisense.

* Add useLowerCase flag and settings tests
2016-09-25 12:53:28 -07:00
Karl Burtram
03315475cb Misc. cleanup for PR 2016-09-19 12:32:56 -07:00
Karl Burtram
e74a392ca9 Improve autocomplete locking 2016-09-18 01:54:32 -07:00
Karl Burtram
1671f762bf Autocomplete bug fixes (#43)
Fix-up the autocomplete support to better handle binding timeouts.
Also provide a default keyword suggestion list.
2016-09-13 15:22:57 -07:00