Skip to content

Commit 4bd136a

Browse files
authored
Merge pull request #252 from mhutch/packaging-fixes
VSCode extension packaging fixes
2 parents 06a7118 + c889616 commit 4bd136a

File tree

8 files changed

+27
-17
lines changed

8 files changed

+27
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: Pack VSCode Extension
6262
working-directory: msbuild-editor-vscode
63-
run: npx vsce package --no-git-tag-version --pre-release ${{ steps.nbgv.outputs.NpmPackageVersion }}
63+
run: npm run vsix-pack
6464

6565
- uses: actions/upload-artifact@v4
6666
if: startsWith(matrix.os, 'windows')

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ node_modules
1212
.vscode-test
1313
dist
1414

15+
# these are copied during vsix packaging
1516
/msbuild-editor-vscode/LICENSE
1617
/msbuild-editor-vscode/server
1718
/msbuild-editor-vscode/*.vsix
19+
/msbuild-editor-vscode/icon.png

MonoDevelop.MSBuild/Analyzers/AppendNoWarnAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AppendNoWarnAnalyzer : MSBuildAnalyzer
1717
readonly MSBuildDiagnosticDescriptor AppendNoWarn = new (
1818
DiagnosticId,
1919
"Append NoWarn values to existing value",
20-
"When settings the `NoWarn` property, you should append the additional values to the existing value of the property. " +
20+
"When setting the `NoWarn` property, you should append the additional values to the existing value of the property. " +
2121
"Otherwise, you may accidentally remove existing values.",
2222
MSBuildDiagnosticSeverity.Warning
2323
);

MonoDevelop.MSBuild/Language/CoreDiagnostics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class CoreDiagnostics
138138
public const string DeprecatedWithMessage_Id = nameof(DeprecatedWithMessage);
139139
public static readonly MSBuildDiagnosticDescriptor DeprecatedWithMessage = new (
140140
DeprecatedWithMessage_Id,
141-
"Deprecated {0}",
141+
"Deprecated symbol",
142142
"The {0} `{1}` is deprecated: {2}",
143143
MSBuildDiagnosticSeverity.Warning
144144
);

art/icon-128.png

8.16 KB
Loading

msbuild-editor-vscode/.vscodeignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ node_modules/**
55
src/**
66
.gitignore
77
.yarnrc
8-
webpack.config.js
9-
vsc-extension-quickstart.md
108
**/tsconfig.json
119
**/.eslintrc.json
1210
**/*.map
1311
**/*.ts
14-
**/.vscode-test.*
12+
**/.vscode-test.*
13+
14+
# the images for the README.md are in this directory so the paths
15+
# are correct when the README.md is viewed in the repo. however, they
16+
# are not needed in the vsix as README.md in the generated package
17+
# has the paths rewritten to https URLs to the GitHub repo
18+
images/**

msbuild-editor-vscode/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,37 @@ The extension is also available [for Visual Studio](https://marketplace.visualst
1616

1717
MSBuild-specific IntelliSense helps you write your project and target files, with rich contextual completion for MSBuild elements, attributes and expressions.
1818

19-
![Property completion](images/vscode-nowarn-completion.png)
19+
![Property completion](./images/vscode-nowarn-completion.png)
2020

2121
The completion for `PackageReference` attributes queries NuGet.org as you type, and provides completion for package names and package versions.
2222

23-
![Package reference completion](images/vscode-packageref-completion.png)
23+
![Package reference completion](./images/vscode-packageref-completion.png)
2424

2525
There's completion for MSBuild expressions, including condition comparisons, property functions and item functions. The editor also supports *Expand Selection* within MSBuild expressions.
2626

27-
![Expression completion](images/vscode-expression-completion.png)
27+
![Expression completion](./images/vscode-expression-completion.png)
2828

29-
![Condition completion](images/vscode-condition-completion.png)
29+
![Condition completion](./images/vscode-condition-completion.png)
3030

3131
### Navigation
3232

3333
You can use the *Go to Definition* command or *Ctrl-Click* to navigate to any import, SDK or filename. If an import has multiple valid ways it can be evaluated, you can navigate to any of them. When navigating to an SDK, you can navigate to any of the `.props` and `.targets` in it.
3434

3535
The *Find References* command can accurately and precisely find all references to items, properties, metadata and tasks throughout your project and its imports, including in expressions.
3636

37-
![Find References](images/vscode-find-references.png)
37+
![Find References](./images/vscode-find-references.png)
3838

3939
### Quick Info
4040

4141
Quick Info tooltips for items, properties, metadata and values allow you to see their descriptions and expected value types, with deep links into documentation. Tooltips for imports and SDKs show you the paths of the imported files.
4242

43-
![Quick info](images/vscode-quick-info.png)
43+
![Quick info](./images/vscode-quick-info.png)
4444

4545
### Validation and Analyzers
4646

4747
The editor validates your document against the MSBuild language and any imported schemas, and shows these errors and warnings as you type.
4848

49-
![Unknown value validation](images/vscode-validation.png)
49+
![Unknown value validation](./images/vscode-validation.png)
5050

5151
The core validator performs several other diagnostics such as warning about unused symbols, and there is a Roslyn-like analyzer mechanism, and examples of current built-in analyzers include:
5252

@@ -57,15 +57,15 @@ The core validator performs several other diagnostics such as warning about unus
5757

5858
The editor supports code fixes for several diagnostics, and has refactorings such as *Extract Expression*.
5959

60-
![Code fix for misspelled property value](images/vscode-code-fix.png)
60+
![Code fix for misspelled property value](./images/vscode-code-fix.png)
6161

6262
### Schemas
6363

6464
In addition to the schema inferred from the items, metadata, properties and tasks used in a project's imports, the extension also defines a json-based MSBuild-specific schema format that can be used to provide documentation, type annotations, allowed values, and other information that is used to provide a richer editing and validation experience.
6565

6666
Any targets file can provide a schema 'sidecar', which has the same name as the targets file except with the suffix `.buildschema.json`. The editor will load the sidecar schemas for any targets that it imports. This allows MSBuild targets to provide their own documentation.
6767

68-
![Schema for MSBuild items](images/vscode-schema.png)
68+
![Schema for MSBuild items](./images/vscode-schema.png)
6969

7070
The extension includes built-in schemas for `Microsoft.Common.targets`, `Microsoft.NET.Sdk`, and other common targets and MSBuild SDKs.
7171

msbuild-editor-vscode/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"author": {
99
"name": "Mikayla Hutchinson"
1010
},
11+
"icon": "icon.png",
1112
"repository": {
1213
"type": "git",
1314
"url": "https://github.com/mhutch/MonoDevelop.MSBuildEditor.git"
@@ -25,7 +26,7 @@
2526
"activationEvents": [],
2627
"main": "./dist/extension.js",
2728
"scripts": {
28-
"vscode:prepublish": "cp ../LICENSE . && npm run publish-server && npm run package",
29+
"vscode:prepublish": "npm run publish-server && npm run copy-vsix-assets && npm run package",
2930
"compile": "npm run check-types && npm run lint && node esbuild.js",
3031
"watch": "npm-run-all -p watch:*",
3132
"watch:esbuild": "node esbuild.js --watch",
@@ -37,7 +38,10 @@
3738
"check-types": "tsc --noEmit",
3839
"lint": "eslint src --ext ts",
3940
"test": "vscode-test",
40-
"publish-server": "dotnet publish ../MSBuildLanguageServer/MSBuildLanguageServer.csproj --configuration Debug --output ./server"
41+
"publish-server": "dotnet publish ../MSBuildLanguageServer/MSBuildLanguageServer.csproj --configuration Debug --output ./server",
42+
"copy-vsix-assets": "cp ../LICENSE . && cp ../art/icon-128.png icon.png",
43+
"vsix-pack": "pwsh -c \"vsce package --baseImagesUrl https://github.com/mhutch/MonoDevelop.MSBuildEditor/raw/HEAD/msbuild-editor-vscode --no-update-package-json --no-git-tag-version --pre-release $(nbgv get-version -v NpmPackageVersion)\"",
44+
"vsix-install": "pwsh -c \"npm run vsix-pack && code --install-extension msbuild-editor-$(nbgv get-version -v NpmPackageVersion).vsix\""
4145
},
4246
"dependencies": {
4347
"@vscode/extension-telemetry": "^0.9.0",

0 commit comments

Comments
 (0)