Commit Graph

62 Commits

Author SHA1 Message Date
Kevin Cunnane
e1c8cc5ac3 Formatter and PeekDefinition Telemetry (#245)
- Add telemetry point for format requests
- Update PeekDefinition telemetry so that it captures whether the attempt succeeded and if it was connected. This will help us understand whether our current behavior of just notifying success/failure to the output window was useful or not. It will also help us understand whether we're doing a good job implementing this / if we need to improve reliability and preformance.
2017-02-21 21:26:10 -08:00
Karl Burtram
5d0c187684 Clear and rebuild IntelliSense cache (#238)
* Stage changes to other machine

* IntelliSense cache rebuild command

* Move to other machine

* Add a test for overwriting binding queue.

* Move event handler into lanaguageservice.cs
2017-02-16 12:23:26 -08:00
Kevin Cunnane
7477642854 TSQL Formatter Service (#229)
- TSqlFormatterService with support for formatting document and text range inside document
- Settings support for all formatting options.
- Extensibility support so that the service can be initialized using MEF extensibility, and can find all necessary TSqlFormatters using the same process

Fix Initialize request error on startup
- Messages were being read from the input channel before all request handlers were registered
- In particular, the Initialize request which is key for any server to talk to the client was getting lost because the message reader thread begins consuming, and we take an extra few hundred milliseconds due to MEF startup before we register the handler
- The solution is to initialize the message handler so request handlers can register, but not actually start processing incoming messages until all handers are ready. This is a safer way to go and should improve reliability overall

Improvements from internal prototype:
- Normalizing baselines to handle the line ending differences on Mac & Linux vs. Windows
- Significantly shortened most lines by implementing base class methods to wrap common objects from Visitor.Context and removing unnecessary "this." syntax
- Refactored the SqlCommonTableExpressionFormatter and related classes to reduce code count significantly. This provides a pattern to follow when refactoring other classes for similar clarity. It's likely a lot of common logic could be found and reused across these.
- Reduced overall code size by adding utility methods
2017-02-14 23:40:17 -08:00
Aditya Bist
eb4f2f2b91 port batch parser wrapper (#232)
* Initial commit for GitHub IO pages

* Add initial doxfx content

* Update manifest.json

* Update manifest.json

* Set theme jekyll-theme-cayman

* Set theme jekyll-theme-slate

* Set theme jekyll-theme-minimal

* Set theme jekyll-theme-tactile

* Clear out theme setting

* Remove API docs

* Revert "Adding Milliseconds to DateTime fields (#173)" (#197)

This reverts commit 431dfa4156.

* ported new BatchParser

* added BatchParser tests

* fixing merge conflicts

* fix build issues

* cleaned code and addressed comments from code review

* addressed code review and made BatchParser logic more efficient

* fixed batch parser tests

* changed class name to fix build issues

* fixed merge conflicts

* added path for lab mode baseline tests

* changed env path for lab mode

* added env variable to appveyor

* testing env variable for appveyor

* fixed lab build

* debug appveyor build

* testing changes for appveyor

* changed trace env path

* debugging appveyor build

* changed baseline env path

* debugging

* debugging

* debugging

* switched on trace flag

* debugging

* debugging

* changed build config

* changed baseline files

* checking baseline output

* changed baseline files

* debug baseline tests

* debugging baseline

* debugging

* debugging

* debug

* debugging

* testing baseline format

* debug

* debug

* debug

* debug

* debug

* newline debug

* changed baseline file

* debug

* test

* try new way to read

* added execution engine tests

* change test

* testing file encoding

* moved execution engine tests to integration

* try compare without spaces

* removed no op test

* added env variable for travis

* put batch parser tests to integration too

* put batch parser in integration

* try new baseline string match

* compare baseline test logic changed

* changed baseline logic as well as cleaned tests

* fix build for travis CI

* fix travis CI issues

* fixed highlighting bugs on vscode

* code review changes

* ported new BatchParser

* added BatchParser tests

* Initial commit for GitHub IO pages

* Add initial doxfx content

* Update manifest.json

* Update manifest.json

* Set theme jekyll-theme-cayman

* Set theme jekyll-theme-slate

* Set theme jekyll-theme-minimal

* Set theme jekyll-theme-tactile

* Clear out theme setting

* Remove API docs

* Revert "Adding Milliseconds to DateTime fields (#173)" (#197)

This reverts commit 431dfa4156.

* fixing merge conflicts

* fix build issues

* cleaned code and addressed comments from code review

* addressed code review and made BatchParser logic more efficient

* fixed batch parser tests

* changed class name to fix build issues

* fixed merge conflicts

* added path for lab mode baseline tests

changed env path for lab mode

added env variable to appveyor

testing env variable for appveyor

fixed lab build

debug appveyor build

testing changes for appveyor

changed trace env path

debugging appveyor build

changed baseline env path

debugging

debugging

debugging

switched on trace flag

debugging

debugging

changed build config

changed baseline files

checking baseline output

changed baseline files

debug baseline tests

debugging baseline

debugging

debugging

debug

debugging

testing baseline format

debug

debug

debug

debug

debug

newline debug

changed baseline file

debug

test

try new way to read

added execution engine tests

change test

testing file encoding

moved execution engine tests to integration

try compare without spaces

removed no op test

added env variable for travis

* put batch parser tests to integration too

* put batch parser in integration

try new baseline string match

* compare baseline test logic changed

* changed baseline logic as well as cleaned tests

* fix build for travis CI

* fix travis CI issues

* fixed highlighting bugs on vscode

* code review changes

* fixed filestream writer test

* added localization string

* added localization string

* generated new string files again

* code review changes
2017-02-10 16:51:26 -08:00
Aditya Bist
c9513890b2 added unit test for temp tables 2017-02-09 18:20:05 -08:00
Sharon Ravindran
b10d6bdfdc Check database case sensitivity for peek definition token matching (#227)
* Check database case sensitivity before peek definition token matching

* Add sr gen

* add tests for ignore case

* remove sr.Designer
2017-02-08 12:34:01 -08:00
Sharon Ravindran
50195faced Fix to get the current database context for peek definition (#220)
* Get db name from query connection

* Add comments

* Correct typos

* revert changes to .sln

* Add unit tests

* Fix typo

* Fix error due to a mistyped comment
2017-02-03 17:50:55 -08:00
Leila Lali
dcff5dd915 New tool to store SQL connection configs locally (#218)
* added a new tool to store SQL connections locally. Modified the peek definition tests to create test database before running test


* fixed failing test QueryExecutionPlanInvalidParamsTest

* Fixes based on code review comments

* fixed failing test GetSignatureHelpReturnsNotNullIfParseInfoInitialized
2017-01-25 16:19:27 -08:00
Sharon Ravindran
5464e4e63a Feature/peek def code gen (#215)
* Add codeGen for existing types

* Modify code gen logic to match current code

* Extend logic for new smo objects

* Add logic to retrieve token type from QuickInfo

* Remove duplicate types

* Add tests for new types

* Modify GetScript logic to use suggestions first

* Add more tests

* Modify codeGen to include quickInfo logic

* Cake build changes to run CodeGen

* CodeGen replace indentation

* Refactor GetScript and add more tests

* Refactor Resolver calls

* Fix TestDriver test for Definition

* Change quickInfo string case

* Revert change sto .sln file

* Fix typos in comments

* change String to string

* Rename test sql objects
2017-01-19 13:24:58 -08:00
Leila Lali
b353b2137e New test common project for database connections using the settings.json (#210)
* moved test driver tests and test common classes to separate projects
2017-01-11 13:47:56 -08:00
Leila Lali
379decf4e9 added support for QUOTED_IDENTIFIER in auto complete list (#190)
*  added support for QUOTED_IDENTIFIER in auto complete list
2017-01-04 14:03:10 -08:00
Connor Quagliana
3ad7cc1a8b Move Integration Tests to dedicated project (#201)
Add IntegrationTests project. Move all tests ifdef'd with LIVE_CONNECTION_TESTS to IntegrationTests project. Delete files that have no remaining code. Update codecoverage.bat to run integration tests
2017-01-04 11:37:57 -08:00
Karl Burtram
5b41538d22 Turning off a broken test until a fix can be merged (#207) 2017-01-03 13:28:48 -08:00
Connor Quagliana
ba12a80fbf Add fix for SendEvent causing test to fail (#195)
Add flag in ServiceHost to ignore SendEvent errors
2016-12-19 14:01:03 -08:00
Aditya Bist
1a2e802a5d Merge pull request #191 from Microsoft/customerIssue/escapeReservedWordsAutocomplete
reserved words with brackets in autocomplete
2016-12-19 11:25:18 -08:00
Aditya Bist
cde7bd49b3 added tests for new scenario 2016-12-19 10:53:20 -08:00
Connor Quagliana
319c5ef7ed Merge pull request #193 from Microsoft/bug/addGetSignatureHelpTest
Add positive test for GetSignatureHelp
2016-12-16 11:08:34 -08:00
Connor Quagliana
2db585ad63 Removed #define 2016-12-15 13:46:25 -08:00
Connor Quagliana
b5cd9d6359 Changed line parameter to zero-indexed 2016-12-15 13:45:29 -08:00
Sharon Ravindran
5d2bf7fbe4 Feature/delete peek scripts (#174)
* Delete temp script folder

* Delete folder and refactor code

* Add unit tests

* create folder per workspace

* Refactor and move creation to FileUtils

* Separate multiple assignment
2016-12-15 13:34:33 -08:00
Connor Quagliana
d5de4c8b21 Merge branch 'dev' into bug/addGetSignatureHelpTest 2016-12-15 12:01:00 -08:00
Connor Quagliana
2f1debc7c9 Added positive test for GetSignatureHelp 2016-12-15 11:40:10 -08:00
Sharon Ravindran
9c6162282a Add error handling for Azure Exceptions (#177)
* Add error handling for Azure Exceptions

* Add SRGen for string

* Add specific exception messages

* Move DefinitionResult class

* Add SqlLogin constant

* Add error scenarios

* revert timeout duration

* Modify tests

* Modify tests

* Add tests

* Revert live connection definition

* Modify DefinitionsHandlerWithNoConnectionTest

* fix test after merge

* Code review changes

* Code review changes

* Code review changes
2016-12-14 16:04:47 -08:00
Karl Burtram
dd41e0545a Add tests to improve code coverage (#187)
* DbColumn and ReliableConnection tests

* More retry connection tests

* More tests

* Fix broken peek definition integration tests

* Fix test bug

* Add a couple batch tests

* Add some more tests

* More tests for code coverage.

* Validation and Diagnostic tests

* A few more tests

* A few mote test changes.

* Update file path tests to run on Windows only
2016-12-14 13:49:42 -08:00
Leila Lali
e9398f7182 Sending status change notifications from server (#186)
* Sending status change notifications from server
2016-12-14 13:19:02 -08:00
Connor Quagliana
40c1434745 Fixed null ref exception in GetSignatureHelp (#175)
- Fixed a few places where ScriptParseInfo was being used before it was verified to be non-null
- Added 1 basic test for GetSignatureHelp scenario
2016-12-09 15:18:08 -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
Sharon Ravindran
ab97948005 Fix/peek def mac (#170)
* Fix Integrated auth error and Uri for *nix/Mac

* Format code

* Add Logging and unit tests

* Modify tests for Windows:

* Workaround missing default schema on *nix and Mac

* Add unit tests

* Correct comments

* Change loop length

* Fix Log message
2016-12-07 16:52:35 -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
Sharon Ravindran
82a7a01304 Peek definition support for tables, views and stored procedures (#160)
* Add support for peek/go to definition
Add unit tests for definition

Microsoft/vscode-mssql#253 and Microsoft/vscode-mssql#268

* Format Strings

* Add integration tests

* Refactor variable names

* Remove test file

* Remove LIVE_CONNECTION definition

* Change method name

* Write files to a separate directory

* Refactor GetDefinition

* Remove unnecessary whitespace and modify variable name

* Check intellisense settings

* Refactor code to be scalable and modify tests

* Refactor to facilitate CodeGen

* Reorder methods

* Modify method to strip bracket syntax

* Add one_second constant

* Add comments

* Modify null check

* Modify GetSchema code to account for spaces

* Alter variable names and modify null checks

* Remove timeout callback and refactor null check

* remove LIVE_CONNECTION_TEST definition
2016-12-02 12:16:21 -08:00
Benjamin Russell
db1e4ae351 Fix Code Coverage (#151)
This is another large code review. I want to make a few more changes, but since these changes will stand on their own, I'll hold back on making this change set any larger than it already is.
Changes in this request:
To address Microsoft/vscode-mssql#326, instead of doing taskkill on the service layer when WaitForExit is executed, we now make an educated guess at which service layer was spawned when the test starts and do a Process.Kill on it when we shut down the test.
All the perf tests have been moved into a new project. This was done to keep them easily separated from code coverage test runs. At the same time the perf tests were separated into separate classes for logical categorization. This process will likely be repeated on the stress tests. The tests can still easily be ran from Visual Studio Test Explorer
To address Microsoft/vscode-mssql#349, a new SelfCleaningFile class was created to allow for easy cleanup of temporary files generated for integration tests via using blocks.
Due to some of the refactoring done while moving the perf tests to a new project, the TestBase class had to be switched to more of a helper class style. As such, all tests that use inherit from TestBase now create a TestBase object on start via a using block. This also simplifies the cleanup at the end of the test.

* Solution for hanging code coverage runs

Code coverage runs would hang in certain scenarios if a test failed before
the service process could be spawned. The taskkill command would fail to
find the service process. The test would then wait for opencover to exit,
but it would not since the service process it had spawned would still be
running, causing the test run to hang indefinitely.

Solution was to capture the service process after it launched and
explicitly kill it when shutting down the test driver.

* Setting the test name in the propery in the class and removign the parameter from each method

* New project for perf tests

* Reworking integration tests to cleanup temp files

* Changes as per @llali review comments

* Adding copyright notices
* Renaming TestBase => TestHelper
* Renaming SelfCleaningFile => SelfCleaningTempFile
* Removing code that sets TestName property

* Fixing compilation error due to removed code
2016-11-18 17:46:56 -08:00
Mitchell Sternke
5a5f197276 Removed unneeded broken test (#150) 2016-11-15 17:57:03 -08:00
Karl Burtram
6cdaa6e808 Add more test cases for code coverage (#127)
Next round of code coverage test cases.  Please review the commit for next iteration.

* Add connection retry tests

* More test coverage

* Update diagnostics end-to-end test
2016-10-29 12:10:02 -07:00
Karl Burtram
d42a92dd94 Test fixes to enable integration suites 2016-10-26 22:44:21 -07:00
Karl Burtram
b0f7ba4084 Turn on disabled tests in integration suite (#120)
No real code changes, just reenabling disabled tests in integration test runs.
2016-10-27 05:00:14 +00:00
Karl Burtram
854a6a0eca Switch back to event from locks to fix blocking issues. (#111) 2016-10-21 15:46:33 -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
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
c6a2568075 Fix an issue with queue deadlocks causing test failures (#77) 2016-10-05 20:35:57 -04:00
Mitchell Sternke
8408bc6dff 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
2016-10-04 15:45:52 -07: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
3777cceb57 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.
2016-09-26 20:11:26 -07:00
Karl Burtram
5a198e3f45 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.
2016-09-26 10:29:49 -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
159362f01b Disable failing test while investigating 2016-09-20 23:52:31 -07:00
Karl Burtram
701aba8d46 Add some tests to increase code coverage metrics 2016-09-19 18:21:48 -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
Karl Burtram
1332fd112e Clean-up the autocomplete SMO integration. 2016-09-01 00:23:39 -07:00
Karl Burtram
f88619c09e Update unit tests to fix failures from autocomplete refactoring 2016-08-31 12:25:07 -07:00
Karl Burtram
b8329a7986 Merge branch 'dev' into feature/testSmo 2016-08-24 23:04:24 -07:00