Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] [VS Live Share] Restrict language services to file/untitled schemes #1298

Merged
merged 2 commits into from
Apr 9, 2018

Conversation

lostintangent
Copy link
Member

@lostintangent lostintangent commented Apr 4, 2018

In preparation for Visual Studio Live Share adding support for "guests" to receive remote language services for Python, this PR simply updates the current DocumentSelector to be limited to file and untitled (unsaved) files. This way, when someone has the Python extension installed, and joins a Live Share session (where files use the vsls: scheme), their language services will be entirely derived from the remote/host side, which provides a more accurate and project-wide experience (guests in Live Share don't have local file access to the project they're collaborating with).

If someone joins a Python project using Live Share, and doesn't have the Python extension installed, then they will automatically receive language services from the host (which is awesome! 🎉), so this PR is simply an optimization for the case where collaborating developers both have the Python extension installed. Additionally, this wouldn't impact the "local" Python development experience.

Note: As an example, the TypeScript/JavaScript language services that come in-box with VS Code already have this scheme restriction, and so this PR replicates that behavior.

// CC @DonJayamanne

@brettcannon
Copy link
Member

@lostintangent we noticed you closed a similar PR for the Java extension. Is there anything we need to be worried about with this PR in relation to that?

@lostintangent
Copy link
Member Author

@brettcannon Nope! I sent out the same PR to the Java extension as well (and PHP). I only closed the first PR attempt because my commit messages failed a validation check they require, so it was just easier to “redo” it (as a non-Git pro).

@codecov
Copy link

codecov bot commented Apr 6, 2018

Codecov Report

Merging #1298 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1298      +/-   ##
==========================================
- Coverage   71.09%   71.06%   -0.04%     
==========================================
  Files         267      267              
  Lines       12350    12350              
  Branches     2188     2188              
==========================================
- Hits         8780     8776       -4     
- Misses       3431     3434       +3     
- Partials      139      140       +1
Impacted Files Coverage Δ
src/client/activation/classic.ts 97.5% <100%> (-0.07%) ⬇️
src/client/extension.ts 96.12% <100%> (+0.03%) ⬆️
src/client/debugger/PythonProcess.ts 45.83% <0%> (-2.09%) ⬇️
src/client/linters/baseLinter.ts 87.5% <0%> (-1.05%) ⬇️
...rc/client/debugger/PythonProcessCallbackHandler.ts 53.61% <0%> (+0.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e40ce2...50e3552. Read the comment docs.

@DonJayamanne
Copy link

lgtm, @brettcannon do we need a news file for this. we can create that separately.
@lostintangent I'll merge this sometime today.

@lostintangent
Copy link
Member Author

@DonJayamanne Thanks so much!

@brettcannon brettcannon merged commit 63b7410 into microsoft:master Apr 9, 2018
brettcannon pushed a commit to brettcannon/vscode-python that referenced this pull request Jul 18, 2018
* Add support for multi roots for formatting and linting (microsoft#1281)

* update to use latest api

* config changes for multiroot workspace

* linting support with multi roots

* multi root support for formatters

* determine workspace root path

* revert change

* support multiple configs per workspace folder

* modify formatters to use resource specific settings

* modified to settings are resolved using document uri

* 1228 multi root master (#1)

* fix microsoft#1280 handle env in shebang (microsoft#1290)

* handle shebangs that resolve paths from env

* oops

* make test more specific

* handle promise

* fix microsoft#1282 use PYTHONIOENCODING variable (microsoft#1291)

* fix microsoft#1270 debugger contribution changes (microsoft#1288)

* add onDebug activation

* use debug config provider for non workspace debugging

* forgot to save file before commiting a merge

* ability to opt out of telemetry using vscode settings (microsoft#1297)

* Fix microsoft#1284 debugging parameterized tests (microsoft#1299)

* fix microsoft#1298 remove vscode.startDebug command (microsoft#1300)

* fix microsoft#1298 remove vscode.startDebug command

* fix code review comments

* added period as per code review comments

* microsoft#1288 installer config and tests (microsoft#1302)

* update to use latest api

* config changes for multiroot workspace

* linting support with multi roots

* multi root support for formatters

* determine workspace root path

* revert change

* support multiple configs per workspace folder

* modify formatters to use resource specific settings

* modified installer to pass resource for workspace resolution

* null test in installer

* canges to config settings to support multiroot workspace

* changes to code refactoring to support workspace symbols

* oops

* modified to settings are resolved using document uri

* unit tests for multi root support

* fix unittests for multiroot

* exclude files

* add new line

* config changes for multiroot workspace

* new lines and enabled multi root linter tests

* fix sys variables

* added unit test to resolve ${workspaceRoot} in settings.json

* fixed code review comments

* fixed code review comments

* fix microsoft#1276 Pre-commit hooks to ensure code complies with standards (microsoft#1277)

* sanitize code

* gulp file to check code hygiene

* fix preLaunchTask in launch.json

* added missing packages

* enabled pre-commit using husky

* enabled a few checks for precommit hook

* fix tslint warnings when running tslint via gulp

* exclude webpack building, else tries to pull in tests as well

* improved checks for commits (strict)

* added new lines

* 1228 multi root workspace symbols (microsoft#1307)

* update to use latest api

* config changes for multiroot workspace

* linting support with multi roots

* multi root support for formatters

* determine workspace root path

* revert change

* support multiple configs per workspace folder

* modify formatters to use resource specific settings

* modified installer to pass resource for workspace resolution

* null test in installer

* canges to config settings to support multiroot workspace

* changes to code refactoring to support workspace symbols

* oops

* modified to settings are resolved using document uri

* unit tests for multi root support

* fix unittests for multiroot

* exclude files

* add new line

* config changes for multiroot workspace

* new lines and enabled multi root linter tests

* fix sys variables

* added unit test to resolve ${workspaceRoot} in settings.json

* microsoft#1228 workspace symbols with multiroot support

* fix test

* added some data for workspace symbol tests

* data for unit tests

* fixed to add support for multit roots with unit tests

* account for mutiroot files in sub directory

* disable all but multiroot tests

* fixed tests

* include files for tests

* Fixed travis tests for multi root workspace symbols (microsoft#1306)

* added logging

* more logging

* yay

* fixed

* more fixes

* fix tests

* removed logging

* enable all tests

* uncommented

* Added brackets around print statements (for p3)

* Fixed travis unit tests (microsoft#1308)

* update to use latest api

* config changes for multiroot workspace

* linting support with multi roots

* multi root support for formatters

* determine workspace root path

* revert change

* support multiple configs per workspace folder

* modify formatters to use resource specific settings

* modified installer to pass resource for workspace resolution

* null test in installer

* canges to config settings to support multiroot workspace

* changes to code refactoring to support workspace symbols

* oops

* modified to settings are resolved using document uri

* unit tests for multi root support

* fix unittests for multiroot

* exclude files

* add new line

* config changes for multiroot workspace

* new lines and enabled multi root linter tests

* fix sys variables

* added unit test to resolve ${workspaceRoot} in settings.json

* microsoft#1228 workspace symbols with multiroot support

* fix test

* added some data for workspace symbol tests

* data for unit tests

* fixed to add support for multit roots with unit tests

* account for mutiroot files in sub directory

* disable all but multiroot tests

* fixed tests

* fix tests

* test where failing

* properly determine root workspace

* fix pytest unit test

* delete files

* add awaiter

* use a path that works on multiple os

* fixes

* uncomment

* invert

* debug statements

* use default workspace

* reverted unwanted changes

* oops

* test unittests only

* more logging

* partial fixes to unit tests

* run all tests

* changes not to set paths for shebang tests

* remove comments

* update settings only if necessary

* fix test

* include files for tests

* Fixed travis tests for multi root workspace symbols (microsoft#1306)

* added logging

* more logging

* yay

* fixed

* more fixes

* fix tests

* removed logging

* enable all tests

* uncommented

* Added brackets around print statements (for p3)

* use resource when getting settings

* fix microsoft#1315 unit tests need to wait for extension to activate (microsoft#1316)

* fix microsoft#1314 allow for simultaneous language features (microsoft#1317)

* microsoft#1228 support multi roots in language service (microsoft#1309)

* update to use latest api

* config changes for multiroot workspace

* linting support with multi roots

* multi root support for formatters

* determine workspace root path

* revert change

* support multiple configs per workspace folder

* modify formatters to use resource specific settings

* modified installer to pass resource for workspace resolution

* null test in installer

* canges to config settings to support multiroot workspace

* changes to code refactoring to support workspace symbols

* oops

* modified to settings are resolved using document uri

* unit tests for multi root support

* fix unittests for multiroot

* exclude files

* add new line

* config changes for multiroot workspace

* new lines and enabled multi root linter tests

* fix sys variables

* added unit test to resolve ${workspaceRoot} in settings.json

* microsoft#1228 workspace symbols with multiroot support

* fix test

* added some data for workspace symbol tests

* data for unit tests

* fixed to add support for multit roots with unit tests

* account for mutiroot files in sub directory

* disable all but multiroot tests

* fixed tests

* fix tests

* test where failing

* properly determine root workspace

* fix pytest unit test

* delete files

* add awaiter

* use a path that works on multiple os

* fixes

* uncomment

* invert

* debug statements

* use default workspace

* reverted unwanted changes

* oops

* test unittests only

* more logging

* partial fixes to unit tests

* run all tests

* changes not to set paths for shebang tests

* remove comments

* update settings only if necessary

* fix test

* include files for tests

* Fixed travis tests for multi root workspace symbols (microsoft#1306)

* added logging

* more logging

* yay

* fixed

* more fixes

* fix tests

* removed logging

* enable all tests

* uncommented

* Added brackets around print statements (for p3)

* use resource when getting settings

* support multiroot in language services

* add additional tests for microsoft#1314 (microsoft#1318)

* microsoft#1228 run all tests under multiroot (microsoft#1322)

* modifications to fix tests to run under multi root setup

* log errors

* fix return type

* fix linter messages

* fix linter errors

* changes to ensure code is formatted correctly

* fixed comments

* delete unwanted file

* hide unwanted folders

* fixes to linters to run on multiroot setup

* udpate settings sequentially

* log the output

* show errors in deleting dir

* removed prospector test, to be completed in microsoft#1319

* fixes to tests and sorting provider

* fixed test for interpreter display

* undo commenting of code

* add new line

* fix code review issues

* ensure else is properly formatted

* fix code review comments

* fix microsoft#1304 preserve empty lines (microsoft#1329)

* microsoft#1228 multiroot interpreter display (microsoft#1339)

* modifications to fix tests to run under multi root setup

* log errors

* fix return type

* fix linter messages

* fix linter errors

* changes to ensure code is formatted correctly

* fixed comments

* delete unwanted file

* hide unwanted folders

* fixes to linters to run on multiroot setup

* udpate settings sequentially

* log the output

* show errors in deleting dir

* removed prospector test, to be completed in microsoft#1319

* fixes to tests and sorting provider

* fixed test for interpreter display

* undo commenting of code

* add new line

* support multi root in interpreter display

* fix linter

* changed package version

* disabled multiroot test

* backwards compatible change

* fix nose tests

* revert change

* enable test but disable it

* multi root support in utils.ts

* fixed microsoft#1328

* retries for flaky unit tests

* retry beforeEach

* common retry decorator

* enable telemetry for extension loads

* disable jupyter tests in multiroot tests

* clean up python Path before and after testsclean up python Path before and after tests

* rename test env variable

* dispose cfg settings

* dispose cfg settings

* update comment

* clean up

* rearrange to ensurfe launching ext is first debug option

* bug fix for display name

* resolved code review comment

* Fixed typp

* 1228 multiroot interpreter ui changes (microsoft#1345)

* fixes to unit tests and forgotten multiroot

* globally retry all tests 3 times

* refactor changing interpreters

* added tests

* fixed linter

* removed redundant files

* removed unwanted grep

* remove blank line

* fix 948 remove hardcoding of port number (microsoft#1353)

* fix microsoft#1041 when debugging a test do not cancel it when re-discovering tests (microsoft#1354)

* fix 1041 when debugging a test do not cancel it when re-discovering tests

* create enum for creation of cancellation token

* dispose correct cancellationToken

* bug fix - in unit tests

* bug fix - in unit tests

* microsoft#1228 multiroot unit test runner (microsoft#1357)

* fixes to unit tests and forgotten multiroot

* globally retry all tests 3 times

* refactor changing interpreters

* added tests

* fixed linter

* removed redundant files

* temp changes

* more changes

* lots of refactoring

* adding support for multiroot workspaces

* removed grep

* copy changes for microsoft#948 and microsoft#1353 into multroot

* replicate solution for microsoft#1041 and microsoft#1354

* microsoft#1041 create enum for creation of cancellation token

* multiroot support for unit tests

* remove empty line (linter warning)

* delete pyc before making changes to py file

* delete pyc file in teardown

* merged multiroot master

* pass uri of workspace when displaing prompt for configuration

* pass uri to commands

* fixed typos based on code review

* prefix path with forward slash, as is done in the extension  unit tests

* include version number into display name
@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants