-
Notifications
You must be signed in to change notification settings - Fork 59
Init extension #1
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
Merged
Merged
Changes from 25 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
c306e7e
init
paulacamargo25 9839a83
Add config files
paulacamargo25 b492f86
add lint file
paulacamargo25 3f9a1cb
fix code
paulacamargo25 92b60c3
Add tests
paulacamargo25 2409e4a
Add clientOS
paulacamargo25 8f8216a
Update pythonAPI
paulacamargo25 0811725
add vscode ignore
paulacamargo25 0a7c477
Update imports
paulacamargo25 239150f
Fix debugger tests, with new pythonAPI calls
paulacamargo25 88b82b7
update factory
paulacamargo25 833e794
update code
paulacamargo25 b096ff8
Add prettier
paulacamargo25 c197a94
run prettier
paulacamargo25 12ed5fb
fix code
paulacamargo25 710cd46
update import
paulacamargo25 42c4842
Update code
paulacamargo25 388c5c0
remove tests
paulacamargo25 de9b578
fix initiation
paulacamargo25 5c935b5
Clean code
paulacamargo25 9fc78ab
Update debug type name
paulacamargo25 84bc90f
Update name, add translations and commands
paulacamargo25 2f4bc3a
Update extension activation
paulacamargo25 9227b7c
remove activationManager
paulacamargo25 b0ffa21
Remove unnecessary files
paulacamargo25 2e19a6d
Remove unnecessarya activation fields
paulacamargo25 d341028
Update pipelines
paulacamargo25 13a8c54
Update and remove unnecessary code
paulacamargo25 1dac1ad
Update debug configuration schema
paulacamargo25 2ff8656
Update package.json
paulacamargo25 651f29b
remove extensions
paulacamargo25 299b6e5
remove inversify
paulacamargo25 167d57f
Fix telemetry
paulacamargo25 94104c3
Update Settings
paulacamargo25 dcbbf01
refactor logging
paulacamargo25 6861a9c
migrate to node16
paulacamargo25 c2b1fa8
Fix package json
paulacamargo25 d3a29e0
Remove process and factory
paulacamargo25 3d6a6e6
Update init
paulacamargo25 269571b
remove inject
paulacamargo25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"@typescript-eslint/naming-convention": "warn", | ||
"@typescript-eslint/semi": "warn", | ||
"curly": "warn", | ||
"eqeqeq": "warn", | ||
"no-throw-literal": "warn", | ||
"semi": "off" | ||
}, | ||
"ignorePatterns": [ | ||
"out", | ||
"dist", | ||
"**/*.d.ts" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
out | ||
dist | ||
node_modules | ||
.vscode-test/ | ||
*.vsix | ||
.venv/ | ||
.nox/ | ||
bundled/libs/ | ||
**/__pycache__ | ||
**/.pytest_cache | ||
**/.vs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
printWidth: 120, | ||
tabWidth: 4, | ||
endOfLine: 'auto', | ||
trailingComma: 'all', | ||
overrides: [ | ||
{ | ||
files: ['*.yml', '*.yaml'], | ||
options: { | ||
tabWidth: 2 | ||
} | ||
} | ||
] | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
// See http://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// A launch configuration that compiles the extension and then opens it inside a new window | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/dist/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
}, | ||
{ | ||
"name": "Unit Tests", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
"--extensionTestsPath=${workspaceFolder}/out/test/index" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js", | ||
"${workspaceFolder}/dist/**/*.js" | ||
], | ||
"preLaunchTask": "tasks: watch-tests" | ||
}, | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"files.exclude": { | ||
"out": false, // set this to true to hide the "out" folder with the compiled JS files | ||
"dist": false // set this to true to hide the "dist" folder with the compiled JS files | ||
}, | ||
"search.exclude": { | ||
"out": true, // set this to false to include "out" folder in search results | ||
"dist": true // set this to false to include "dist" folder in search results | ||
}, | ||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts | ||
"typescript.tsc.autoDetect": "off" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"problemMatcher": "$ts-webpack-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never", | ||
"group": "watchers" | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "watch-tests", | ||
"problemMatcher": "$tsc-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never", | ||
"group": "watchers" | ||
}, | ||
"group": "build" | ||
}, | ||
{ | ||
"label": "tasks: watch-tests", | ||
"dependsOn": ["npm: watch", "npm: watch-tests"], | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
out/** | ||
node_modules/** | ||
src/** | ||
.gitignore | ||
.yarnrc | ||
webpack.config.js | ||
vsc-extension-quickstart.md | ||
**/tsconfig.json | ||
**/.eslintrc.json | ||
**/*.ts | ||
.venv/** | ||
.nox/** | ||
.github/ | ||
**/__pycache__/** | ||
**/.pyc | ||
bundled/libs/bin/** | ||
noxfile.py | ||
.pytest_cache/** | ||
.pylintrc | ||
**/requirements.txt | ||
**/requirements.in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Run on a schedule | ||
trigger: none | ||
pr: none | ||
|
||
schedules: | ||
- cron: '0 10 * * 1-5' # 10AM UTC (2AM PDT) MON-FRI (VS Code Pre-release builds at 9PM PDT) | ||
displayName: Nightly Pre-Release Schedule | ||
always: false # only run if there are source code changes | ||
branches: | ||
include: | ||
- main | ||
|
||
resources: | ||
repositories: | ||
- repository: templates | ||
type: github | ||
name: microsoft/vscode-engineering | ||
ref: main | ||
endpoint: Monaco | ||
|
||
extends: | ||
template: azure-pipelines/extension/pre-release.yml@templates | ||
parameters: | ||
locTsConfigs: $(Build.SourcesDirectory)/tsconfig.json | ||
locBundleDestination: $(Build.SourcesDirectory)/dist | ||
buildSteps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '14.18.2' | ||
displayName: Select Node version | ||
|
||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.7' | ||
addToPath: true | ||
architecture: 'x64' | ||
displayName: Select Python version | ||
|
||
- script: npm ci | ||
displayName: Install NPM dependencies | ||
|
||
- script: python -m pip install -U pip | ||
displayName: Upgrade pip | ||
|
||
- script: python -m pip install wheel | ||
displayName: Install wheel | ||
|
||
- script: python -m pip install nox | ||
displayName: Install wheel | ||
|
||
- script: python -m nox --session install_bundled_libs | ||
displayName: Install Python dependencies | ||
|
||
- script: python ./build/update_ext_version.py --for-publishing | ||
displayName: Update build number | ||
|
||
- script: npm run package | ||
displayName: Build extension |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
trigger: none | ||
# branches: | ||
# include: | ||
# - release* | ||
# tags: | ||
# include: ['*'] | ||
pr: none | ||
|
||
resources: | ||
repositories: | ||
- repository: templates | ||
type: github | ||
name: microsoft/vscode-engineering | ||
ref: main | ||
endpoint: Monaco | ||
|
||
parameters: | ||
- name: publishExtension | ||
displayName: 🚀 Publish Extension | ||
type: boolean | ||
default: false | ||
|
||
extends: | ||
template: azure-pipelines/extension/stable.yml@templates | ||
parameters: | ||
locTsConfigs: $(Build.SourcesDirectory)/tsconfig.json | ||
locBundleDestination: $(Build.SourcesDirectory)/dist | ||
publishExtension: ${{ parameters.publishExtension }} | ||
buildSteps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '14.18.2' | ||
paulacamargo25 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
displayName: Select Node version | ||
|
||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.7' | ||
addToPath: true | ||
architecture: 'x64' | ||
displayName: Select Python version | ||
|
||
- script: npm ci | ||
displayName: Install NPM dependencies | ||
|
||
- script: python -m pip install -U pip | ||
displayName: Upgrade pip | ||
|
||
- script: python -m pip install wheel | ||
displayName: Install wheel | ||
|
||
- script: python -m pip install nox | ||
displayName: Install wheel | ||
|
||
- script: python -m nox --session install_bundled_libs | ||
displayName: Install Python dependencies | ||
|
||
- script: python ./build/update_ext_version.py --release --for-publishing | ||
displayName: Update build number | ||
|
||
- script: npm run package | ||
displayName: Build extension |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import json | ||
|
||
import freezegun | ||
import pytest | ||
import update_ext_version | ||
|
||
TEST_DATETIME = "2022-03-14 01:23:45" | ||
|
||
# The build ID is calculated via: | ||
# "1" + datetime.datetime.strptime(TEST_DATETIME,"%Y-%m-%d %H:%M:%S").strftime('%j%H%M') | ||
EXPECTED_BUILD_ID = "10730123" | ||
|
||
|
||
def create_package_json(directory, version): | ||
"""Create `package.json` in `directory` with a specified version of `version`.""" | ||
package_json = directory / "package.json" | ||
package_json.write_text(json.dumps({"version": version}), encoding="utf-8") | ||
return package_json | ||
|
||
|
||
def run_test(tmp_path, version, args, expected): | ||
package_json = create_package_json(tmp_path, version) | ||
update_ext_version.main(package_json, args) | ||
package = json.loads(package_json.read_text(encoding="utf-8")) | ||
assert expected == update_ext_version.parse_version(package["version"]) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"version, args", | ||
[ | ||
("1.0.0-rc", []), | ||
("1.1.0-rc", ["--release"]), | ||
("1.0.0-rc", ["--release", "--build-id", "-1"]), | ||
("1.0.0-rc", ["--release", "--for-publishing", "--build-id", "-1"]), | ||
("1.0.0-rc", ["--release", "--for-publishing", "--build-id", "999999999999"]), | ||
("1.1.0-rc", ["--build-id", "-1"]), | ||
("1.1.0-rc", ["--for-publishing", "--build-id", "-1"]), | ||
("1.1.0-rc", ["--for-publishing", "--build-id", "999999999999"]), | ||
], | ||
) | ||
def test_invalid_args(tmp_path, version, args): | ||
with pytest.raises(ValueError): | ||
run_test(tmp_path, version, args, None) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"version, args, expected", | ||
[ | ||
("1.1.0-rc", ["--build-id", "12345"], ("1", "1", "12345", "rc")), | ||
("1.0.0-rc", ["--release", "--build-id", "12345"], ("1", "0", "12345", "")), | ||
( | ||
"1.1.0-rc", | ||
["--for-publishing", "--build-id", "12345"], | ||
("1", "1", "12345", ""), | ||
), | ||
( | ||
"1.0.0-rc", | ||
["--release", "--for-publishing", "--build-id", "12345"], | ||
("1", "0", "12345", ""), | ||
), | ||
( | ||
"1.0.0-rc", | ||
["--release", "--build-id", "999999999999"], | ||
("1", "0", "999999999999", ""), | ||
), | ||
( | ||
"1.1.0-rc", | ||
["--build-id", "999999999999"], | ||
("1", "1", "999999999999", "rc"), | ||
), | ||
("1.1.0-rc", [], ("1", "1", EXPECTED_BUILD_ID, "rc")), | ||
( | ||
"1.0.0-rc", | ||
["--release"], | ||
("1", "0", "0", ""), | ||
), | ||
( | ||
"1.1.0-rc", | ||
["--for-publishing"], | ||
("1", "1", EXPECTED_BUILD_ID, ""), | ||
), | ||
( | ||
"1.0.0-rc", | ||
["--release", "--for-publishing"], | ||
("1", "0", "0", ""), | ||
), | ||
( | ||
"1.0.0-rc", | ||
["--release"], | ||
("1", "0", "0", ""), | ||
), | ||
( | ||
"1.1.0-rc", | ||
[], | ||
("1", "1", EXPECTED_BUILD_ID, "rc"), | ||
), | ||
], | ||
) | ||
@freezegun.freeze_time("2022-03-14 01:23:45") | ||
def test_update_ext_version(tmp_path, version, args, expected): | ||
run_test(tmp_path, version, args, expected) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.