Skip to content

Commit

Permalink
Merge pull request #3985 from OmniSharp/register-fixall-commands
Browse files Browse the repository at this point in the history
Register FixAll commands for disposal
  • Loading branch information
JoeRobich authored Aug 16, 2020
2 parents 35cb919 + b927ed8 commit 3179582
Show file tree
Hide file tree
Showing 7 changed files with 850 additions and 137 deletions.
7 changes: 7 additions & 0 deletions .mocharc.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ui": "tdd",
"require": [
"source-map-support/register",
"ts-node/register"
]
}
3 changes: 0 additions & 3 deletions mocha.opts

This file was deleted.

2 changes: 1 addition & 1 deletion offline.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ node_modules
gulpfile.ts
!install.Lock
ISSUE_TEMPLATE
mocha.opts
.mocharc.jsonc
*.vscodeignore
package-lock.json
package.json
Expand Down
957 changes: 830 additions & 127 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
"compile": "tsc -p ./ && gulp tslint",
"compileDev": "tsc -p ./ && gulp tslint && webpack --mode development",
"watch": "tsc -watch -p ./",
"tdd": "mocha --opts ./mocha.opts --watch --watch-extensions ts test/unitTests/**/*.test.ts*",
"tdd": "mocha --config ./.mocharc.jsonc --watch --watch-extensions ts test/unitTests/**/*.test.ts*",
"test": "gulp test",
"test:unit": "gulp test:unit",
"test:feature": "gulp test:feature",
"test:integration": "gulp test:integration",
"test:integration:singleCsproj": "gulp test:integration:singleCsproj",
"test:integration:slnWithCsproj": "gulp test:integration:slnWithCsproj",
"test:release": "mocha --opts ./mocha.opts test/releaseTests/**/*.test.ts",
"test:artifacts": "mocha --opts ./mocha.opts test/artifactTests/**/*.test.ts",
"test:release": "mocha --config ./.mocharc.jsonc test/releaseTests/**/*.test.ts",
"test:artifacts": "mocha --config ./.mocharc.jsonc test/artifactTests/**/*.test.ts",
"postinstall": "node ./node_modules/vscode/bin/install",
"cov:instrument": "gulp cov:instrument",
"cov:merge": "gulp cov:merge",
Expand Down Expand Up @@ -136,7 +136,7 @@
"gulp-tslint": "8.1.3",
"istanbul": "0.4.5",
"ltcdr": "2.2.1",
"mocha": "5.2.0",
"mocha": "^8.1.1",
"mocha-typescript": "1.1.17",
"mock-fs": "4.8.0",
"mock-http-server": "0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion release.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ node_modules/**
gulpfile.ts
install.Lock
ISSUE_TEMPLATE
mocha.opts
.mocharc.jsonc
*.vscodeignore
package-lock.json
package.json
Expand Down
8 changes: 7 additions & 1 deletion src/omnisharp/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ export async function activate(context: vscode.ExtensionContext, packageJSON: an
localDisposables.add(vscode.languages.registerCompletionItemProvider(documentSelector, new CompletionItemProvider(server, languageMiddlewareFeature), '.', ' '));
localDisposables.add(vscode.languages.registerWorkspaceSymbolProvider(new WorkspaceSymbolProvider(server, optionProvider, languageMiddlewareFeature)));
localDisposables.add(vscode.languages.registerSignatureHelpProvider(documentSelector, new SignatureHelpProvider(server, languageMiddlewareFeature), '(', ','));
// Since the CodeActionProvider registers its own commands, we must instantiate it and add it to the localDisposables
// so that it will be cleaned up if OmniSharp is restarted.
const codeActionProvider = new CodeActionProvider(server, optionProvider, languageMiddlewareFeature);
localDisposables.add(codeActionProvider);
localDisposables.add(vscode.languages.registerCodeActionsProvider(documentSelector, codeActionProvider));
localDisposables.add(vscode.languages.registerCodeActionsProvider(documentSelector, new FixAllProvider(server, languageMiddlewareFeature)));
// Since the FixAllProviders registers its own commands, we must instantiate it and add it to the localDisposables
// so that it will be cleaned up if OmniSharp is restarted.
const fixAllProvider = new FixAllProvider(server, languageMiddlewareFeature);
localDisposables.add(fixAllProvider);
localDisposables.add(vscode.languages.registerCodeActionsProvider(documentSelector, fixAllProvider));
localDisposables.add(reportDiagnostics(server, advisor, languageMiddlewareFeature));
localDisposables.add(forwardChanges(server));
localDisposables.add(trackVirtualDocuments(server, eventStream));
Expand Down

0 comments on commit 3179582

Please sign in to comment.