Skip to content

Commit

Permalink
refactor: remove web intellisense support
Browse files Browse the repository at this point in the history
close #2475
  • Loading branch information
johnsoncodehk committed Mar 2, 2023
1 parent 9c3e970 commit 65f4119
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 174 deletions.
2 changes: 1 addition & 1 deletion packages/vscode-vue/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
let modulePath = './dist/node/client';
let modulePath = './dist/client';
try { modulePath = require.resolve('./out/nodeClientMain'); } catch { }
module.exports = require(modulePath);
24 changes: 9 additions & 15 deletions packages/vscode-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
"onLanguage:typescriptreact"
],
"main": "client",
"browser": "dist/browser/client",
"capabilities": {
"virtualWorkspaces": {
"supported": "limited",
"description": "Install https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-web to have IntelliSense for .vue files in Web IDE."
},
"untrustedWorkspaces": {
"supported": "limited",
"description": "%volar.workspaceTrust.description%",
Expand Down Expand Up @@ -741,18 +744,11 @@
},
"scripts": {
"prebuild": "cd ../.. && npm run build",
"build": "npm run build:node && npm run build:browser",
"watch": "npm run build:node -- --watch & npm run build:browser -- --watch",
"build:node": "node scripts/build-node",
"build:browser": "node scripts/build-browser",
"prepack:bundle-size": "npm run prebuild && npm run build:node -- --minify --metafile && npm run build:browser -- --empty",
"prepack:node": "npm run prebuild && npm run build:node -- --minify && npm run build:browser -- --empty",
"prepack:browser": "npm run prebuild && npm run build:browser -- --minify && npm run build:node -- --empty",
"pack:node": "npm run prepack:node && vsce package",
"pack:browser": "npm run prepack:browser && vsce package",
"release:node": "npm run prepack:node && vsce publish --target win32-x64 win32-ia32 win32-arm64 linux-x64 linux-arm64 linux-armhf darwin-x64 darwin-arm64 alpine-x64 alpine-arm64",
"release:browser": "npm run prepack:browser && vsce publish --target web",
"release": "npm run release:node && npm run release:browser",
"build": "node scripts/build",
"watch": "npm run build -- --watch",
"prepack": "npm run prebuild && npm run build -- --minify",
"pack": "npm run prepack && vsce package",
"release": "npm run prepack && vsce publish",
"bundle-size": "npm run prepack:bundle-size && esbuild-visualizer --metadata ./meta.json && open ./stats.html"
},
"devDependencies": {
Expand All @@ -766,8 +762,6 @@
"esbuild": "0.15.18",
"esbuild-plugin-copy": "latest",
"esbuild-visualizer": "latest",
"path-browserify": "^1.0.1",
"punycode": "^2.3.0",
"semver": "^7.3.8",
"typesafe-path": "^0.2.2",
"vsce": "latest",
Expand Down
84 changes: 0 additions & 84 deletions packages/vscode-vue/scripts/build-browser.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ const path = require('path');
const fs = require('fs');

require('esbuild').build({
entryPoints: process.argv.includes('--empty') ? {
client: './scripts/empty.js',
server: './scripts/empty.js',
} : {
entryPoints: {
client: './out/nodeClientMain.js',
server: './node_modules/@volar/vue-language-server/out/nodeServer.js',
},
bundle: true,
metafile: process.argv.includes('--metafile'),
outdir: './dist/node',
outdir: './dist',
external: [
'vscode',
'typescript', // vue-component-meta
Expand Down
1 change: 0 additions & 1 deletion packages/vscode-vue/scripts/empty.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/vscode-vue/scripts/process-shim.js

This file was deleted.

43 changes: 0 additions & 43 deletions packages/vscode-vue/src/browserClientMain.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/vscode-vue/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async function doActivate(context: vscode.ExtensionContext, createLc: CreateLang

for (const client of clients) {
activateShowReferences(client);
activateServerSys(context, client);
activateServerSys(context, client, undefined);
}

async function requestReloadVscode() {
Expand Down
6 changes: 3 additions & 3 deletions packages/vue-language-service/tests/utils/createTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import * as path from 'path';
import { URI } from 'vscode-uri';
import { createLanguageService } from '@volar/language-service';

const uriToFileName = (uri: string) => URI.parse(uri).fsPath.replace(/\\/g, '/');
const fileNameToUri = (fileName: string) => URI.file(fileName).toString();
const testRoot = path.resolve(__dirname, '../../../vue-test-workspace');

export const rootUri = URI.file(testRoot);
export const tester = createTester(testRoot);

const uriToFileName = (uri: string) => URI.parse(uri).fsPath.replace(/\\/g, '/');
const fileNameToUri = (fileName: string) => URI.file(fileName).toString();

function createTester(root: string) {

const parseConfigHost: ts.ParseConfigHost = {
Expand Down
13 changes: 0 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65f4119

Please sign in to comment.