Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions explorer-v2/src/lib/AstExplorer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@
);

let tsParser = undefined;
function setTSParser(parser) {
if (typeof window !== 'undefined') {
if (!window.process) {
window.process = {
cwd: () => '',
env: {}
};
}
}
tsParser = parser;
}
$: {
if (hasLangTs && !tsParser) {
import('@typescript-eslint/parser').then((parser) => {
if (typeof window !== 'undefined') {
if (!window.process) {
window.process = {
cwd: () => '',
env: {}
};
}
}
tsParser = parser;
});
import('@typescript-eslint/parser').then(setTSParser);
}
}

Expand Down
23 changes: 12 additions & 11 deletions explorer-v2/src/lib/ESLintPlayground.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@

$: hasLangTs = /lang\s*=\s*(?:"ts"|ts|'ts'|"typescript"|typescript|'typescript')/u.test(code);
let tsParser = undefined;
function setTSParser(parser) {
if (typeof window !== 'undefined') {
if (!window.process) {
window.process = {
cwd: () => '',
env: {}
};
}
}
tsParser = parser;
}
$: {
if (hasLangTs && !tsParser) {
import('@typescript-eslint/parser').then((parser) => {
if (typeof window !== 'undefined') {
if (!window.process) {
window.process = {
cwd: () => '',
env: {}
};
}
}
tsParser = parser;
});
import('@typescript-eslint/parser').then(setTSParser);
}
}

Expand Down
33 changes: 17 additions & 16 deletions explorer-v2/src/lib/MonacoEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,7 @@
$: {
disposeCodeActionProvider();
if (provideCodeActions) {
loadingMonaco.then((monaco) => {
codeActionProviderDisposable = monaco.languages.registerCodeActionProvider(language, {
provideCodeActions(model, range, context) {
const editor = getLeftEditor?.();
if (editor?.getModel().url !== model.url) {
return {
actions: [],
dispose() {
/* nop */
}
};
}
return provideCodeActions(model, range, context);
}
});
});
loadingMonaco.then((monaco) => setupCodeActionProvider(monaco, provideCodeActions));
}
}

Expand Down Expand Up @@ -216,6 +201,22 @@
}
}

function setupCodeActionProvider(monaco, provideCodeActions) {
codeActionProviderDisposable = monaco.languages.registerCodeActionProvider(language, {
provideCodeActions(model, range, context) {
const editor = getLeftEditor?.();
if (editor?.getModel().url !== model.url) {
return {
actions: [],
dispose() {
/* nop */
}
};
}
return provideCodeActions(model, range, context);
}
});
}
function disposeCodeActionProvider() {
if (codeActionProviderDisposable) {
codeActionProviderDisposable.dispose();
Expand Down
23 changes: 12 additions & 11 deletions explorer-v2/src/lib/ScopeExplorer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,20 @@
svelteValue
);
let tsParser = undefined;
function setTSParser(parser) {
if (typeof window !== 'undefined') {
if (!window.process) {
window.process = {
cwd: () => '',
env: {}
};
}
}
tsParser = parser;
}
$: {
if (hasLangTs && !tsParser) {
import('@typescript-eslint/parser').then((parser) => {
if (typeof window !== 'undefined') {
if (!window.process) {
window.process = {
cwd: () => '',
env: {}
};
}
}
tsParser = parser;
});
import('@typescript-eslint/parser').then(setTSParser);
}
}
$: {
Expand Down
58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,54 +63,54 @@
"postcss-selector-parser": "^7.0.0"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"@changesets/get-release-plan": "^4.0.5",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.28.1",
"@changesets/get-release-plan": "^4.0.8",
"@ota-meshi/eslint-plugin": "^0.17.6",
"@ota-meshi/test-snapshot": "^1.1.0",
"@types/benchmark": "^2.1.5",
"@types/chai": "^5.0.0",
"@types/chai": "^5.2.1",
"@types/eslint": "^9.6.1",
"@types/eslint-scope": "^3.7.7",
"@types/eslint-visitor-keys": "^3.3.2",
"@types/estree": "^1.0.6",
"@types/estree": "^1.0.7",
"@types/mocha": "^10.0.10",
"@types/node": "^22.10.1",
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@types/node": "^22.13.13",
"@types/semver": "^7.7.0",
"@typescript-eslint/eslint-plugin": "^8.28.0",
"@typescript-eslint/parser": "~8.28.0",
"@typescript-eslint/types": "~8.28.0",
"benchmark": "^2.1.4",
"c8": "^10.1.2",
"chai": "^5.0.0",
"c8": "^10.1.3",
"chai": "^5.2.0",
"env-cmd": "^10.1.0",
"esbuild": "^0.25.0",
"esbuild": "^0.25.1",
"eslint": "~9.23.0",
"eslint-config-prettier": "^10.0.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsdoc": "^50.6.0",
"eslint-plugin-json-schema-validator": "^5.2.0",
"eslint-plugin-jsonc": "^2.18.2",
"eslint-plugin-n": "^17.14.0",
"eslint-plugin-jsdoc": "^50.6.9",
"eslint-plugin-json-schema-validator": "^5.3.1",
"eslint-plugin-jsonc": "^2.20.0",
"eslint-plugin-n": "^17.17.0",
"eslint-plugin-node-dependencies": "^0.12.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-prettier": "^5.2.5",
"eslint-plugin-regexp": "^2.7.0",
"eslint-plugin-svelte": "^2.46.1",
"eslint-plugin-yml": "^1.16.0",
"eslint-plugin-svelte": "^3.3.3",
"eslint-plugin-yml": "^1.17.0",
"globals": "^16.0.0",
"locate-character": "^3.0.0",
"magic-string": "^0.30.14",
"mocha": "^11.0.0",
"prettier": "~3.5.0",
"magic-string": "^0.30.17",
"mocha": "^11.1.0",
"prettier": "~3.5.3",
"prettier-plugin-pkg": "^0.18.1",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-svelte": "^3.3.3",
"rimraf": "^6.0.1",
"semver": "^7.6.3",
"svelte": "^5.9.0",
"svelte2tsx": "^0.7.28",
"tsx": "^4.19.2",
"typescript": "~5.8.0",
"typescript-eslint": "^8.16.0",
"semver": "^7.7.1",
"svelte": "^5.25.3",
"svelte2tsx": "^0.7.35",
"tsx": "^4.19.3",
"typescript": "~5.8.2",
"typescript-eslint": "^8.28.0",
"typescript-eslint-parser-for-extra-files": "^0.7.0"
},
"publishConfig": {
Expand Down
Loading