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
1 change: 1 addition & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ IZ = "IZ"
shft = "shft"
multline = "multline"
sav = "sav"
ist = "ist"
19 changes: 16 additions & 3 deletions bun.lock

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

85 changes: 78 additions & 7 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"plugins": {
"cordova-clipboard": {},
"cordova-plugin-device": {},
"cordova-plugin-file": {},
"cordova-plugin-file": {
"ANDROIDX_WEBKIT_VERSION": "1.4.0"
},
"cordova-plugin-server": {},
"cordova-plugin-ftp": {},
"cordova-plugin-sdcard": {},
Expand Down Expand Up @@ -102,6 +104,7 @@
"cordova-plugin-system": "file:src/plugins/system",
"cordova-plugin-websocket": "file:src/plugins/websocket",
"css-loader": "^7.1.4",
"happy-dom": "^20.11.1",
"mini-css-extract-plugin": "^2.10.2",
"path-browserify": "^1.0.1",
"postcss-loader": "^8.2.1",
Expand Down Expand Up @@ -146,7 +149,7 @@
"@codemirror/language-data": "^6.5.2",
"@codemirror/legacy-modes": "^6.5.3",
"@codemirror/lint": "^6.9.7",
"@codemirror/lsp-client": "^6.2.5",
"@codemirror/lsp-client": "github:Acode-Foundation/codemirror-lsp-client#db6930c2b6db67e14978f08ae8f5aeb149d29468",
"@codemirror/search": "^6.7.1",
"@codemirror/state": "^6.6.0",
"@codemirror/theme-one-dark": "^6.1.3",
Expand Down
16 changes: 8 additions & 8 deletions src/cm/colorChip.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { LSPClient } from "@codemirror/lsp-client";
import { LSPPlugin } from "@codemirror/lsp-client";
import type { Range } from "@codemirror/state";
import { Decoration, EditorView, WidgetType } from "@codemirror/view";
Expand All @@ -16,6 +17,8 @@ export interface ColorChipPayload {
css: string;
pickerSeed?: string;
source: ColorChipSource;
/** Originating provider for LSP color-presentation requests. */
lspClient?: LSPClient;
}

const chipState = new WeakMap<HTMLElement, ColorChipPayload>();
Expand Down Expand Up @@ -43,6 +46,7 @@ export class ColorChipWidget extends WidgetType {
other.payload.to === this.payload.to &&
other.payload.css === this.payload.css &&
other.payload.source === this.payload.source &&
other.payload.lspClient === this.payload.lspClient &&
(other.payload.pickerSeed || "") === (this.payload.pickerSeed || "")
);
}
Expand Down Expand Up @@ -90,14 +94,10 @@ export function isViewEditable(view: EditorView): boolean {
}

export function hasLspColorProvider(view: EditorView): boolean {
const lsp = LSPPlugin.get(view) as {
client?: {
connected?: boolean;
serverCapabilities?: { colorProvider?: boolean | object } | null;
};
} | null;
return !!(
lsp?.client?.connected && lsp.client.serverCapabilities?.colorProvider
return LSPPlugin.getAll(view, "documentColor").some(
(lsp) =>
lsp.client.connected &&
!!lsp.client.serverCapabilities?.colorProvider,
);
}

Expand Down
Loading