Skip to content

Commit d5a2fd2

Browse files
DillanCMillsDillan Mills
andauthored
Update example extension to detect debug mode better (#210)
* Update example to detect debug mode better * update changelog and contributors * remove old debug check * add missing ExtensionMode import Co-authored-by: Dillan Mills <[email protected]>
1 parent 5c4f6b3 commit d5a2fd2

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ and this project adheres to [Semantic Versioning][semver].
1313

1414
### Fixed
1515

16+
## [0.11.3] - 09/30/2021
17+
18+
### Added
19+
20+
### Changed
21+
22+
### Fixed
23+
24+
- Fix example extension client not detecting debug mode appropriately ([#193])
25+
26+
[#193]: https://github.com/openlawlibrary/pygls/issues/193
27+
1628
## [0.11.2] - 07/23/2021
1729

1830
### Added

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
- [Tomoya Tanjo](https://github.com/tom-tan)
1414
- [yorodm](https://github.com/yorodm)
1515
- [bollwyvl](https://github.com/bollwyvl)
16+
- [Dillan Mills](https://github.com/DillanCMills)

examples/json-extension/client/src/extension.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import * as net from "net";
2222
import * as path from "path";
23-
import { ExtensionContext, workspace } from "vscode";
23+
import { ExtensionContext, ExtensionMode, workspace } from "vscode";
2424
import {
2525
LanguageClient,
2626
LanguageClientOptions,
@@ -44,10 +44,6 @@ function getClientOptions(): LanguageClientOptions {
4444
};
4545
}
4646

47-
function isStartedInDebugMode(): boolean {
48-
return process.env.VSCODE_DEBUG_MODE === "true";
49-
}
50-
5147
function startLangServerTCP(addr: number): LanguageClient {
5248
const serverOptions: ServerOptions = () => {
5349
return new Promise((resolve /*, reject */) => {
@@ -83,7 +79,7 @@ function startLangServer(
8379
}
8480

8581
export function activate(context: ExtensionContext): void {
86-
if (isStartedInDebugMode()) {
82+
if (context.extensionMode === ExtensionMode.Development) {
8783
// Development - Run the server manually
8884
client = startLangServerTCP(2087);
8985
} else {

0 commit comments

Comments
 (0)