Skip to content

Commit 990e2df

Browse files
authored
feat(vscode): rework PDV integration to use new apis & state machine (#2272)
1 parent 68c0b0d commit 990e2df

File tree

16 files changed

+904
-261
lines changed

16 files changed

+904
-261
lines changed

apps/generate-ui-v2-e2e/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"setup-lit-dir": {
2222
"command": "node ./setup-lit-dir.mjs",
23+
"cache": true,
2324
"options": {
2425
"cwd": "apps/generate-ui-v2-e2e"
2526
},

apps/generate-ui-v2/src/components/badge.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { LitElement, html } from 'lit';
22
import { customElement, property } from 'lit/decorators.js';
33
import { EditorContext } from '../contexts/editor-context';
4-
import { when } from 'lit/directives/when.js';
5-
import { t } from 'xstate';
64

75
@customElement('badge-element')
86
export class Banner extends EditorContext(LitElement) {

apps/vscode/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"@nx/nx-linux-x64-gnu": "19.0.3",
6363
"@nx/nx-linux-x64-musl": "19.0.3",
6464
"@nx/nx-win32-arm64-msvc": "19.0.3",
65-
"@nx/nx-win32-x64-msvc": "19.0.3"
65+
"@nx/nx-win32-x64-msvc": "19.0.3",
66+
"@vscode-elements/elements": "^1.6.1"
6667
},
6768
"contributes": {
6869
"typescriptServerPlugins": [

apps/vscode/project.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
}
9292
},
9393
"build": {
94+
"command": "node ./tools/scripts/install-vscode-deps.js",
95+
"dependsOn": ["_build"]
96+
},
97+
"_build": {
9498
"executor": "@nx/esbuild:esbuild",
9599
"options": {
96100
"external": [
@@ -203,10 +207,7 @@
203207
"executor": "nx:run-commands",
204208
"dependsOn": ["build", "^build"],
205209
"options": {
206-
"commands": [
207-
"node ./tools/scripts/vscode-yarn.js",
208-
"node ./tools/scripts/vscode-vsce.js"
209-
],
210+
"commands": ["node ./tools/scripts/vscode-vsce.js"],
210211
"parallel": false
211212
},
212213
"outputs": ["{workspaceRoot}/dist/apps/vscode"]

libs/language-server/watcher/src/lib/daemon-watcher.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ export class DaemonWatcher {
102102
);
103103
}) ?? [];
104104
if (filteredChangedFiles.length === 0) {
105-
lspLogger.log(`filtered out files: ${data?.changedFiles}`);
105+
lspLogger.log(
106+
`filtered out files: ${data?.changedFiles
107+
.map((f) => f.path)
108+
.join(', ')}`
109+
);
106110
return;
107111
}
108112
if (filteredChangedFiles.length) {

libs/vscode/nx-workspace/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ export * from './lib/has-affected-projects';
1515
export * from './lib/get-source-map';
1616
export * from './lib/get-nx-cloud-status';
1717
export * from './lib/get-cloud-onboarding-info';
18+
export * from './lib/get-pdv-data';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { NxPDVDataRequest } from '@nx-console/language-server/types';
2+
import { PDVData } from '@nx-console/shared/types';
3+
import { sendRequest } from '@nx-console/vscode/lsp-client';
4+
5+
export async function getPDVData(
6+
path: string | undefined
7+
): Promise<PDVData | undefined> {
8+
return sendRequest(NxPDVDataRequest, { filePath: path });
9+
}

0 commit comments

Comments
 (0)