Commit Graph

30 Commits

Author SHA1 Message Date
Cheena Malhotra
cea10c13e6 Fixes BindingQueue, GetSignatureHelp and RefreshIntellisenseCache to be truly async (#2175) 2023-08-23 13:46:13 -07:00
Cheena Malhotra
648d7dbd3c Address warnings and (some) nullables (#2013) 2023-04-18 20:57:13 -07:00
Chris LaFreniere
cccdbf0bef Address CA1829 (Avoiding Count LINQ method calls when equivalent + more efficient properties exist) (#1961)
* Address CA1829 (Avoid Count LINQ Method Calls)

* Remove other change

* CA1829 removal

* CA1829 (remove whitespace)
2023-03-23 21:06:49 -07:00
Karl Burtram
f288bee294 Make nullable warnings a per file opt-in (#1842)
* Make nullable warnings a per file opt-in

* Remove unneeded compiler directives

* Remove compiler directive for User Data
2023-02-03 18:10:07 -08:00
Alan Ren
17b6073c87 include additional data for error object (#1539)
* include additional data for error

* fix tests
2022-06-10 20:40:22 -07:00
Charles Gagnon
70be8f5ef5 Don't add parentheses to ANSI Scalar functions (#1487)
* Don't add parentheses to ANSI Scalar functions

* fix test
2022-05-09 18:57:14 -07:00
Charles Gagnon
40c5d48c5e Fail build on unneeded usings (#1417) 2022-03-04 16:38:01 -08:00
Aasim Khan
e246bc5325 Adding star expression expansion (#1270) 2021-10-27 16:59:05 -07:00
David Shiflet
839acf67cd Convert most tools service tests to nunit (#1037)
* Remove xunit dependency from testdriver

* swap expected/actual as needed

* Convert Test.Common to nunit

* port hosting unit tests to nunit

* port batchparser integration tests to nunit

* port testdriver.tests to nunit

* fix target to copy dependency

* port servicelayer unittests to nunit

* more unit test fixes

* port integration tests to nunit

* fix test method type

* try using latest windows build for PRs

* reduce test memory use
2020-08-05 13:43:14 -04:00
Charles Gagnon
7d37de218a Fix to not add parens for global variable built in functions (#940) 2020-04-07 09:56:24 -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
Charles Gagnon
de1bab9f1e Fix Intellisense not working for saved files (#867)
* Fix tools service to store the corrected file path

* Use ClientFilePath for key

* Further fixes

* Undo spacing changes

* Fix tests

* Trigger CI rebuild
2019-09-19 11:28:40 -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
eaaff8b8a1 Remove Peek Definition error popup (#786)
* Remove Peek Definition error popup

* Fix broken test case

* Fix bug
2019-03-22 16:52:45 -07:00
Karl Burtram
6153279840 Update broken BindingQueue test from previous commit (#725) 2018-10-31 15:24:02 -07:00
Matt Irvine
f45155aa4a Fix OE and Binding Queue reliability bugs (#702) 2018-10-05 14:14:36 -07:00
Matt Irvine
aaa3513db2 Unexpected request handler errors no longer crash SQL Tools Service (#591)
* Handler errors no longer crash service

* Disable additional flaky test
2018-03-15 14:14:09 -07:00
Benjamin Russell
e9bc97e290 Edit Data: Better errors for possible truncation (#514)
* Fix to make sql exceptions surface properly to user (with important notes!)

* Adding support for detecting column size issues when updating a cell

* Adding unit tests for the exception on read scenario
2017-10-21 11:08:40 -07:00
Kevin Cunnane
4b66203dfc Fix tools service crash + improve server edition naming (#506)
* Fix https://github.com/Microsoft/vscode-mssql/issues/986 and add better server edition naming
- Fixed a number of issues related to the binding queue, specifically the fact that it didn't capture exceptions that occurred on the binding thread. This caused the thread to crash the service.
  - The root cause of the error was when you get a connection error during init of the SmoMetadataProvider which threw an exception. Because of this no Binder was created, and the code would null ref later during processing
  - Added logic to handle null ref issue and other related code
  - Added a unit test for the new error handling path, and supported still returning some value in this case
- Separately, have a fix for an issue where the edition is shown as "SQL Azure" for all Azure connections. Fixing to be "Azure SQL DB" for this case and handle when the database reports as DW or Stretch instead. This maps better to users concept of what the edition should be and avoids returning what is an outdated term.

* Messed up the test - fixing this by returning the expected return object
2017-10-19 10:42:26 -07:00
Leila Lali
fecf56bce2 closing the default connections that are opned just for validating the connections. Added the feature to application name in the connection (#483) 2017-10-09 10:49:12 -07:00
Aditya Bist
e7756b0bf1 Task/script refactor (#446)
* scripting working with race conditions

* new service works with no race conditions

* use new scripting service and commented out tests

* refactored peek definition to use mssql-scripter

* fixed peek definition tests

* removed auto gen comment

* fixed peek definition highlighting bug

* made scripting async and fixed event handlers

* fixed tests (without cancel and plan notifs)

* removed dead code

* added nuget package

* CR comments + select script service implementation

* minor fixes and added test

* CR comments and script select

* added unit tests

* code review comments and cleanup
2017-10-02 12:02:43 -07:00
Monasr
c90fd3410d Localization check-in for September update (#464)
* Localization check-in for September update

* Fix format of test check that was failing so that if it fails in lab we'll get useful error message
2017-09-20 16:15:55 -07:00
Kevin Cunnane
3aba287759 Fix #911 handle perforce files (#400)
- Additional handling of document events with "perforce:" or other SCM strings
- Much of the handling had been added already, but adding in additional validation and ensuring that everywhere `Workspace.GetFile` is called we add a not-null check to avoid null reference errors
2017-07-05 13:25:05 -07:00
Kevin Cunnane
81d031d5eb LanguageService must send result or intellisense hangs (#395)
* LanguageService must send result or intellisense hangs
- Unless the language services methods return results for requests, the VSCode language service protocol will never send a response up to its higher-level code. This means with intellisense off, it appears to hang instead of saying "No results found". This is clearly sub-optimal and if any other extension wants to provide SQL suggestions, it would break them from sending results
- Minor refactor to fully remove Instance-field references in the code
2017-06-23 13:36:43 -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
Benjamin Russell
e65699ef75 Removing optional data property from Error response class (#325)
* Removing optional data property from Error response class

* Fixing broken unit tests
2017-04-24 13:45:33 -07:00
Benjamin Russell
2eb60f45c9 Send Error Object on SendError (#304)
This change ensures that when calling `requestContext.SendError` you are only able to supply parameters that match the language service beta protocol expected Error object. In other words, you have to provide an error message and optionally and error code.

# **BREAKING API CHANGES**
This will break displaying errors in Microsoft/vscode-mssql. I will be making changes to properly handle the error object shortly.

* Adding contract for returning Error objects as per LanguageService "protocol"

* Fixes throughout codebase to send only error message in error cases
Cleanup of CredentialServiceTest unit test class
Adding standard error handling for event flow validator

* Adding optional data field as per protocol spec
https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md

* Adding optional validation for error objects
2017-04-05 14:47:37 -07:00
Karl Burtram
addad29b7c Add Scripter class and use it in the ScriptingService (#286)
* Initial scripting commit

* Fix the script CREATE integration test

* Use language service binding queue for scripting

* Update scripting service to have methods for each operation

* Add scripter class

* Fix build break.

* Fix a few bugs

* Use scripter class instead of PeekDefinition class.

* Fix scripting test break

* Fix header incorrectly saying file is generated.

* Add localization tests to address a large block of code not covered by automation.

* Moving system usings to top of using list
2017-03-21 13:18:52 -07: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
Benjamin Russell
1166778249 Isolate Shared Test Code (#252)
The goal of this make sure that test code is correctly organized to ensure that test suites aren't dependent on each other.
* UnitTests get their own project now (renaming Microsoft.SqlTools.ServiceLayer.Test to Microsoft.SqlTools.ServiceLayer.UnitTests) which is about 90% of the changes to the files.
* IntegrationTests no longer depends on UnitTests, only Test.Common
* Any shared components from TestObjects that spins up a "live" connection has been moved to IntegrationTests Utility/LiveConnectionHelper.cs
* The dictionary-based mock file stream factory has been moved to Test.Common since it is used by UnitTests and IntegrationTests
    * Added a overload that doesn't take a dictionary for when we don't care about monitoring the storage (about 90% of the time)
* The RunIf* wrapper methods have been moved to Test.Common
* OwnerUri and StandardQuery constants have been moved to Test.Common Constants file

* Updating to latest SDK version available at https://www.microsoft.com/net/core#windowscmd

* Moving unit tests to unit test folder

* Changing namespaces to UnitTests

* Moving some constants and shared functionality into common project, making the UnitTests reference it

* Unit tests are working!

* Integration tests are working

* Updating automated test runs

* Fixing one last broken unit test

* Exposing internals for other projects

* Moving edit data tests to UnitTest project

* Applying refactor fixes to unit tests

* Fixing flaky test that wasn't awaiting completion
2017-03-02 13:00:31 -08:00