@nocturnium/svelte-ide 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +251 -0
- package/dist/components/agents/AgentActivityPanel.svelte +565 -0
- package/dist/components/agents/AgentActivityPanel.svelte.d.ts +24 -0
- package/dist/components/agents/AgentAvatar.svelte +417 -0
- package/dist/components/agents/AgentAvatar.svelte.d.ts +23 -0
- package/dist/components/agents/AgentCursor.svelte +224 -0
- package/dist/components/agents/AgentCursor.svelte.d.ts +35 -0
- package/dist/components/agents/AgentPresenceBar.svelte +261 -0
- package/dist/components/agents/AgentPresenceBar.svelte.d.ts +20 -0
- package/dist/components/agents/index.d.ts +4 -0
- package/dist/components/agents/index.js +5 -0
- package/dist/components/ai/AIConversationList.svelte +524 -0
- package/dist/components/ai/AIConversationList.svelte.d.ts +17 -0
- package/dist/components/ai/AIEditPreview.svelte +132 -0
- package/dist/components/ai/AIEditPreview.svelte.d.ts +8 -0
- package/dist/components/ai/AIInlineEdit.svelte +155 -0
- package/dist/components/ai/AIInlineEdit.svelte.d.ts +10 -0
- package/dist/components/ai/AIMessage.svelte +239 -0
- package/dist/components/ai/AIMessage.svelte.d.ts +13 -0
- package/dist/components/ai/AIMessageActions.svelte +176 -0
- package/dist/components/ai/AIMessageActions.svelte.d.ts +12 -0
- package/dist/components/ai/AIMessageContent.svelte +355 -0
- package/dist/components/ai/AIMessageContent.svelte.d.ts +7 -0
- package/dist/components/ai/AIPanel.svelte +561 -0
- package/dist/components/ai/AIPanel.svelte.d.ts +7 -0
- package/dist/components/ai/AISuggestionWidget.svelte +132 -0
- package/dist/components/ai/AISuggestionWidget.svelte.d.ts +10 -0
- package/dist/components/ai/AIToolCallDisplay.svelte +317 -0
- package/dist/components/ai/AIToolCallDisplay.svelte.d.ts +12 -0
- package/dist/components/ai/index.d.ts +9 -0
- package/dist/components/ai/index.js +10 -0
- package/dist/components/core/Avatar.svelte +110 -0
- package/dist/components/core/Avatar.svelte.d.ts +12 -0
- package/dist/components/core/Badge.svelte +98 -0
- package/dist/components/core/Badge.svelte.d.ts +11 -0
- package/dist/components/core/Button.svelte +175 -0
- package/dist/components/core/Button.svelte.d.ts +18 -0
- package/dist/components/core/ConnectionStatus.svelte +294 -0
- package/dist/components/core/ConnectionStatus.svelte.d.ts +20 -0
- package/dist/components/core/ContextMenu.svelte +176 -0
- package/dist/components/core/ContextMenu.svelte.d.ts +19 -0
- package/dist/components/core/ErrorBoundary.svelte +277 -0
- package/dist/components/core/ErrorBoundary.svelte.d.ts +23 -0
- package/dist/components/core/Icon.svelte +107 -0
- package/dist/components/core/Icon.svelte.d.ts +8 -0
- package/dist/components/core/Input.svelte +138 -0
- package/dist/components/core/Input.svelte.d.ts +20 -0
- package/dist/components/core/Kbd.svelte +34 -0
- package/dist/components/core/Kbd.svelte.d.ts +7 -0
- package/dist/components/core/ResizeHandle.svelte +200 -0
- package/dist/components/core/ResizeHandle.svelte.d.ts +23 -0
- package/dist/components/core/Spinner.svelte +35 -0
- package/dist/components/core/Spinner.svelte.d.ts +7 -0
- package/dist/components/core/Textarea.svelte +112 -0
- package/dist/components/core/Textarea.svelte.d.ts +18 -0
- package/dist/components/core/Tooltip.svelte +103 -0
- package/dist/components/core/Tooltip.svelte.d.ts +11 -0
- package/dist/components/core/index.d.ts +13 -0
- package/dist/components/core/index.js +14 -0
- package/dist/components/editor/AIFocusLayer.svelte +430 -0
- package/dist/components/editor/AIFocusLayer.svelte.d.ts +32 -0
- package/dist/components/editor/Breadcrumbs.svelte +435 -0
- package/dist/components/editor/Breadcrumbs.svelte.d.ts +33 -0
- package/dist/components/editor/BreakpointLayer.svelte +642 -0
- package/dist/components/editor/BreakpointLayer.svelte.d.ts +20 -0
- package/dist/components/editor/CognitiveLoadMeter.svelte +324 -0
- package/dist/components/editor/CognitiveLoadMeter.svelte.d.ts +18 -0
- package/dist/components/editor/CollaborativeEditor.svelte +218 -0
- package/dist/components/editor/CollaborativeEditor.svelte.d.ts +32 -0
- package/dist/components/editor/CommandPalette.svelte +434 -0
- package/dist/components/editor/CommandPalette.svelte.d.ts +11 -0
- package/dist/components/editor/ComplexityLayer.svelte +293 -0
- package/dist/components/editor/ComplexityLayer.svelte.d.ts +23 -0
- package/dist/components/editor/ConflictZoneLayer.svelte +441 -0
- package/dist/components/editor/ConflictZoneLayer.svelte.d.ts +25 -0
- package/dist/components/editor/ContextLens.svelte +262 -0
- package/dist/components/editor/ContextLens.svelte.d.ts +27 -0
- package/dist/components/editor/CustomEditor.svelte +1242 -0
- package/dist/components/editor/CustomEditor.svelte.d.ts +37 -0
- package/dist/components/editor/DebugConsole.svelte +646 -0
- package/dist/components/editor/DebugConsole.svelte.d.ts +41 -0
- package/dist/components/editor/EchoCursorLayer.svelte +363 -0
- package/dist/components/editor/EchoCursorLayer.svelte.d.ts +24 -0
- package/dist/components/editor/Editor.svelte +61 -0
- package/dist/components/editor/Editor.svelte.d.ts +22 -0
- package/dist/components/editor/EditorGutter.svelte +119 -0
- package/dist/components/editor/EditorGutter.svelte.d.ts +19 -0
- package/dist/components/editor/EditorLines.svelte +182 -0
- package/dist/components/editor/EditorLines.svelte.d.ts +43 -0
- package/dist/components/editor/EditorPane.svelte +134 -0
- package/dist/components/editor/EditorPane.svelte.d.ts +9 -0
- package/dist/components/editor/EditorSelections.svelte +186 -0
- package/dist/components/editor/EditorSelections.svelte.d.ts +25 -0
- package/dist/components/editor/EditorTabs.svelte +170 -0
- package/dist/components/editor/EditorTabs.svelte.d.ts +12 -0
- package/dist/components/editor/FileExplorer.svelte +811 -0
- package/dist/components/editor/FileExplorer.svelte.d.ts +67 -0
- package/dist/components/editor/FileIcon.svelte +110 -0
- package/dist/components/editor/FileIcon.svelte.d.ts +10 -0
- package/dist/components/editor/FindReplace.svelte +448 -0
- package/dist/components/editor/FindReplace.svelte.d.ts +40 -0
- package/dist/components/editor/GhostBracketLayer.svelte +391 -0
- package/dist/components/editor/GhostBracketLayer.svelte.d.ts +24 -0
- package/dist/components/editor/GitBlameLayer.svelte +436 -0
- package/dist/components/editor/GitBlameLayer.svelte.d.ts +18 -0
- package/dist/components/editor/InlineDiagnosticsLayer.svelte +540 -0
- package/dist/components/editor/InlineDiagnosticsLayer.svelte.d.ts +35 -0
- package/dist/components/editor/InlineDiffLayer.svelte +337 -0
- package/dist/components/editor/InlineDiffLayer.svelte.d.ts +31 -0
- package/dist/components/editor/MinimalEditor.svelte +75 -0
- package/dist/components/editor/MinimalEditor.svelte.d.ts +6 -0
- package/dist/components/editor/MinimalEditor2.svelte +84 -0
- package/dist/components/editor/MinimalEditor2.svelte.d.ts +6 -0
- package/dist/components/editor/Minimap.svelte +327 -0
- package/dist/components/editor/Minimap.svelte.d.ts +34 -0
- package/dist/components/editor/PluginPreviewSandbox.svelte +793 -0
- package/dist/components/editor/PluginPreviewSandbox.svelte.d.ts +49 -0
- package/dist/components/editor/ProblemsPanel.svelte +628 -0
- package/dist/components/editor/ProblemsPanel.svelte.d.ts +25 -0
- package/dist/components/editor/QuickActionsMenu.svelte +403 -0
- package/dist/components/editor/QuickActionsMenu.svelte.d.ts +18 -0
- package/dist/components/editor/SnippetPalette.svelte +530 -0
- package/dist/components/editor/SnippetPalette.svelte.d.ts +16 -0
- package/dist/components/editor/StructureMap.svelte +431 -0
- package/dist/components/editor/StructureMap.svelte.d.ts +37 -0
- package/dist/components/editor/SymbolOutline.svelte +722 -0
- package/dist/components/editor/SymbolOutline.svelte.d.ts +44 -0
- package/dist/components/editor/TimelineScrubber.svelte +470 -0
- package/dist/components/editor/TimelineScrubber.svelte.d.ts +40 -0
- package/dist/components/editor/TokenRenderer.svelte +69 -0
- package/dist/components/editor/TokenRenderer.svelte.d.ts +15 -0
- package/dist/components/editor/constants.d.ts +32 -0
- package/dist/components/editor/constants.js +36 -0
- package/dist/components/editor/core/ai-awareness.d.ts +176 -0
- package/dist/components/editor/core/ai-awareness.js +210 -0
- package/dist/components/editor/core/bracket-healer.d.ts +189 -0
- package/dist/components/editor/core/bracket-healer.js +406 -0
- package/dist/components/editor/core/breakpoints.d.ts +203 -0
- package/dist/components/editor/core/breakpoints.js +414 -0
- package/dist/components/editor/core/commands.d.ts +108 -0
- package/dist/components/editor/core/commands.js +246 -0
- package/dist/components/editor/core/complexity-analyzer.d.ts +123 -0
- package/dist/components/editor/core/complexity-analyzer.js +376 -0
- package/dist/components/editor/core/conflict-predictor.d.ts +135 -0
- package/dist/components/editor/core/conflict-predictor.js +316 -0
- package/dist/components/editor/core/crdt-binding.d.ts +118 -0
- package/dist/components/editor/core/crdt-binding.js +286 -0
- package/dist/components/editor/core/diagnostics.d.ts +210 -0
- package/dist/components/editor/core/diagnostics.js +335 -0
- package/dist/components/editor/core/echo-cursor.d.ts +201 -0
- package/dist/components/editor/core/echo-cursor.js +267 -0
- package/dist/components/editor/core/folding.d.ts +124 -0
- package/dist/components/editor/core/folding.js +672 -0
- package/dist/components/editor/core/ghost-pair.d.ts +122 -0
- package/dist/components/editor/core/ghost-pair.js +221 -0
- package/dist/components/editor/core/git-blame.d.ts +170 -0
- package/dist/components/editor/core/git-blame.js +324 -0
- package/dist/components/editor/core/index.d.ts +26 -0
- package/dist/components/editor/core/index.js +24 -0
- package/dist/components/editor/core/keybindings.d.ts +79 -0
- package/dist/components/editor/core/keybindings.js +357 -0
- package/dist/components/editor/core/multi-cursor.d.ts +196 -0
- package/dist/components/editor/core/multi-cursor.js +521 -0
- package/dist/components/editor/core/navigation.d.ts +107 -0
- package/dist/components/editor/core/navigation.js +408 -0
- package/dist/components/editor/core/quick-actions.d.ts +189 -0
- package/dist/components/editor/core/quick-actions.js +427 -0
- package/dist/components/editor/core/search.d.ts +88 -0
- package/dist/components/editor/core/search.js +192 -0
- package/dist/components/editor/core/semantic-analyzer.d.ts +77 -0
- package/dist/components/editor/core/semantic-analyzer.js +424 -0
- package/dist/components/editor/core/snippet-manager.d.ts +202 -0
- package/dist/components/editor/core/snippet-manager.js +565 -0
- package/dist/components/editor/core/state.d.ts +367 -0
- package/dist/components/editor/core/state.js +900 -0
- package/dist/components/editor/core/timeline.d.ts +204 -0
- package/dist/components/editor/core/timeline.js +349 -0
- package/dist/components/editor/editor-find.d.ts +56 -0
- package/dist/components/editor/editor-find.js +148 -0
- package/dist/components/editor/editor-input.d.ts +77 -0
- package/dist/components/editor/editor-input.js +445 -0
- package/dist/components/editor/editor-multicursor.d.ts +21 -0
- package/dist/components/editor/editor-multicursor.js +196 -0
- package/dist/components/editor/editor-scroll.d.ts +14 -0
- package/dist/components/editor/editor-scroll.js +34 -0
- package/dist/components/editor/index.d.ts +15 -0
- package/dist/components/editor/index.js +21 -0
- package/dist/components/editor/languages.d.ts +62 -0
- package/dist/components/editor/languages.js +285 -0
- package/dist/components/editor/theme.d.ts +88 -0
- package/dist/components/editor/theme.js +139 -0
- package/dist/components/editor/tokenizer/base.d.ts +40 -0
- package/dist/components/editor/tokenizer/base.js +203 -0
- package/dist/components/editor/tokenizer/index.d.ts +56 -0
- package/dist/components/editor/tokenizer/index.js +215 -0
- package/dist/components/editor/tokenizer/languages/css.d.ts +17 -0
- package/dist/components/editor/tokenizer/languages/css.js +194 -0
- package/dist/components/editor/tokenizer/languages/go.d.ts +17 -0
- package/dist/components/editor/tokenizer/languages/go.js +220 -0
- package/dist/components/editor/tokenizer/languages/html.d.ts +24 -0
- package/dist/components/editor/tokenizer/languages/html.js +145 -0
- package/dist/components/editor/tokenizer/languages/javascript.d.ts +56 -0
- package/dist/components/editor/tokenizer/languages/javascript.js +452 -0
- package/dist/components/editor/tokenizer/languages/json.d.ts +12 -0
- package/dist/components/editor/tokenizer/languages/json.js +91 -0
- package/dist/components/editor/tokenizer/languages/markdown.d.ts +16 -0
- package/dist/components/editor/tokenizer/languages/markdown.js +156 -0
- package/dist/components/editor/tokenizer/languages/python.d.ts +20 -0
- package/dist/components/editor/tokenizer/languages/python.js +227 -0
- package/dist/components/editor/tokenizer/languages/svelte.d.ts +40 -0
- package/dist/components/editor/tokenizer/languages/svelte.js +326 -0
- package/dist/components/editor/tokenizer/types.d.ts +86 -0
- package/dist/components/editor/tokenizer/types.js +4 -0
- package/dist/components/layout/IDELayout.svelte +274 -0
- package/dist/components/layout/IDELayout.svelte.d.ts +29 -0
- package/dist/components/layout/StatusBar.svelte +511 -0
- package/dist/components/layout/StatusBar.svelte.d.ts +47 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.js +3 -0
- package/dist/components/lsp/AutocompleteWidget.svelte +364 -0
- package/dist/components/lsp/AutocompleteWidget.svelte.d.ts +33 -0
- package/dist/components/lsp/DiagnosticMarker.svelte +166 -0
- package/dist/components/lsp/DiagnosticMarker.svelte.d.ts +19 -0
- package/dist/components/lsp/DiagnosticsPanel.svelte +388 -0
- package/dist/components/lsp/DiagnosticsPanel.svelte.d.ts +21 -0
- package/dist/components/lsp/HoverTooltip.svelte +274 -0
- package/dist/components/lsp/HoverTooltip.svelte.d.ts +24 -0
- package/dist/components/lsp/LSPEditor.svelte +486 -0
- package/dist/components/lsp/LSPEditor.svelte.d.ts +39 -0
- package/dist/components/lsp/SignatureHelpWidget.svelte +216 -0
- package/dist/components/lsp/SignatureHelpWidget.svelte.d.ts +22 -0
- package/dist/components/lsp/index.d.ts +6 -0
- package/dist/components/lsp/index.js +7 -0
- package/dist/components/plugins/PluginCard.svelte +153 -0
- package/dist/components/plugins/PluginCard.svelte.d.ts +19 -0
- package/dist/components/plugins/PluginPanel.svelte +280 -0
- package/dist/components/plugins/PluginPanel.svelte.d.ts +8 -0
- package/dist/components/plugins/PluginProposalForm.svelte +250 -0
- package/dist/components/plugins/PluginProposalForm.svelte.d.ts +6 -0
- package/dist/components/plugins/PluginStatusBadge.svelte +14 -0
- package/dist/components/plugins/PluginStatusBadge.svelte.d.ts +8 -0
- package/dist/components/plugins/index.d.ts +4 -0
- package/dist/components/plugins/index.js +5 -0
- package/dist/components/vfs/LockConflictDialog.svelte +705 -0
- package/dist/components/vfs/LockConflictDialog.svelte.d.ts +21 -0
- package/dist/components/vfs/LockIndicator.svelte +194 -0
- package/dist/components/vfs/LockIndicator.svelte.d.ts +29 -0
- package/dist/components/vfs/LockOverlay.svelte +344 -0
- package/dist/components/vfs/LockOverlay.svelte.d.ts +17 -0
- package/dist/components/vfs/VersionConflictDialog.svelte +549 -0
- package/dist/components/vfs/VersionConflictDialog.svelte.d.ts +24 -0
- package/dist/components/vfs/index.d.ts +4 -0
- package/dist/components/vfs/index.js +5 -0
- package/dist/crdt/awareness.d.ts +42 -0
- package/dist/crdt/awareness.js +109 -0
- package/dist/crdt/document.d.ts +101 -0
- package/dist/crdt/document.js +187 -0
- package/dist/crdt/index.d.ts +9 -0
- package/dist/crdt/index.js +8 -0
- package/dist/crdt/provider.d.ts +85 -0
- package/dist/crdt/provider.js +150 -0
- package/dist/crdt/types.d.ts +61 -0
- package/dist/crdt/types.js +4 -0
- package/dist/crdt/undo.d.ts +34 -0
- package/dist/crdt/undo.js +70 -0
- package/dist/index.d.ts +277 -0
- package/dist/index.js +280 -0
- package/dist/plugins/index.d.ts +103 -0
- package/dist/plugins/index.js +153 -0
- package/dist/services/error-handling.d.ts +95 -0
- package/dist/services/error-handling.js +413 -0
- package/dist/services/ide-integration.d.ts +83 -0
- package/dist/services/ide-integration.js +367 -0
- package/dist/services/lsp-client.d.ts +69 -0
- package/dist/services/lsp-client.js +667 -0
- package/dist/services/mock-ai.d.ts +37 -0
- package/dist/services/mock-ai.js +318 -0
- package/dist/services/optimistic.d.ts +141 -0
- package/dist/services/optimistic.js +367 -0
- package/dist/services/vfs-client.d.ts +81 -0
- package/dist/services/vfs-client.js +348 -0
- package/dist/stores/agents.svelte.d.ts +85 -0
- package/dist/stores/agents.svelte.js +459 -0
- package/dist/stores/ai-persistence.svelte.d.ts +76 -0
- package/dist/stores/ai-persistence.svelte.js +334 -0
- package/dist/stores/ai.svelte.d.ts +140 -0
- package/dist/stores/ai.svelte.js +383 -0
- package/dist/stores/collaboration.svelte.d.ts +164 -0
- package/dist/stores/collaboration.svelte.js +334 -0
- package/dist/stores/editor.svelte.d.ts +131 -0
- package/dist/stores/editor.svelte.js +250 -0
- package/dist/stores/index.d.ts +10 -0
- package/dist/stores/index.js +29 -0
- package/dist/stores/layout.svelte.d.ts +171 -0
- package/dist/stores/layout.svelte.js +351 -0
- package/dist/stores/plugin.svelte.d.ts +121 -0
- package/dist/stores/plugin.svelte.js +410 -0
- package/dist/stores/vfs.svelte.d.ts +123 -0
- package/dist/stores/vfs.svelte.js +680 -0
- package/dist/styles/theme.css +623 -0
- package/dist/types/agents.d.ts +127 -0
- package/dist/types/agents.js +5 -0
- package/dist/types/ai.d.ts +137 -0
- package/dist/types/ai.js +4 -0
- package/dist/types/crdt.d.ts +222 -0
- package/dist/types/crdt.js +5 -0
- package/dist/types/editor.d.ts +52 -0
- package/dist/types/editor.js +18 -0
- package/dist/types/events.d.ts +133 -0
- package/dist/types/events.js +4 -0
- package/dist/types/filesystem.d.ts +77 -0
- package/dist/types/filesystem.js +4 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +12 -0
- package/dist/types/lsp.d.ts +691 -0
- package/dist/types/lsp.js +108 -0
- package/dist/types/plugin.d.ts +239 -0
- package/dist/types/plugin.js +5 -0
- package/dist/types/vfs.d.ts +191 -0
- package/dist/types/vfs.js +18 -0
- package/dist/utils/format.d.ts +55 -0
- package/dist/utils/format.js +152 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/keybindings.d.ts +33 -0
- package/dist/utils/keybindings.js +171 -0
- package/dist/utils/language.d.ts +27 -0
- package/dist/utils/language.js +222 -0
- package/package.json +178 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* AutocompleteWidget - LSP completion suggestions dropdown
|
|
4
|
+
*
|
|
5
|
+
* Displays completion items from the language server with:
|
|
6
|
+
* - Item kind icons
|
|
7
|
+
* - Labels and details
|
|
8
|
+
* - Documentation preview
|
|
9
|
+
* - Keyboard navigation
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { CompletionItem, CompletionItemKind } from '../../types/lsp';
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
/** Completion items to display */
|
|
16
|
+
items: CompletionItem[];
|
|
17
|
+
/** Currently selected index */
|
|
18
|
+
selectedIndex?: number;
|
|
19
|
+
/** Position to render the widget */
|
|
20
|
+
position: { x: number; y: number };
|
|
21
|
+
/** Maximum height before scrolling */
|
|
22
|
+
maxHeight?: number;
|
|
23
|
+
/** Called when an item is selected */
|
|
24
|
+
onSelect: (item: CompletionItem) => void;
|
|
25
|
+
/** Called when widget should close */
|
|
26
|
+
onDismiss: () => void;
|
|
27
|
+
/** Called when selection changes */
|
|
28
|
+
onSelectionChange?: (index: number) => void;
|
|
29
|
+
class?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let {
|
|
33
|
+
items,
|
|
34
|
+
selectedIndex = 0,
|
|
35
|
+
position,
|
|
36
|
+
maxHeight = 300,
|
|
37
|
+
onSelect,
|
|
38
|
+
onDismiss,
|
|
39
|
+
onSelectionChange,
|
|
40
|
+
class: className = ''
|
|
41
|
+
}: Props = $props();
|
|
42
|
+
|
|
43
|
+
let listRef: HTMLElement;
|
|
44
|
+
|
|
45
|
+
// Scroll selected item into view
|
|
46
|
+
$effect(() => {
|
|
47
|
+
if (listRef && selectedIndex >= 0) {
|
|
48
|
+
const selectedEl = listRef.children[selectedIndex] as HTMLElement;
|
|
49
|
+
if (selectedEl) {
|
|
50
|
+
selectedEl.scrollIntoView({ block: 'nearest' });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Icon mapping for completion item kinds
|
|
56
|
+
const kindIcons: Record<number, string> = {
|
|
57
|
+
1: 'abc', // Text
|
|
58
|
+
2: 'symbol-method', // Method
|
|
59
|
+
3: 'symbol-function', // Function
|
|
60
|
+
4: 'symbol-constructor', // Constructor
|
|
61
|
+
5: 'symbol-field', // Field
|
|
62
|
+
6: 'symbol-variable', // Variable
|
|
63
|
+
7: 'symbol-class', // Class
|
|
64
|
+
8: 'symbol-interface', // Interface
|
|
65
|
+
9: 'symbol-module', // Module
|
|
66
|
+
10: 'symbol-property', // Property
|
|
67
|
+
11: 'symbol-unit', // Unit
|
|
68
|
+
12: 'symbol-value', // Value
|
|
69
|
+
13: 'symbol-enum', // Enum
|
|
70
|
+
14: 'symbol-keyword', // Keyword
|
|
71
|
+
15: 'symbol-snippet', // Snippet
|
|
72
|
+
16: 'symbol-color', // Color
|
|
73
|
+
17: 'symbol-file', // File
|
|
74
|
+
18: 'symbol-reference', // Reference
|
|
75
|
+
19: 'folder', // Folder
|
|
76
|
+
20: 'symbol-enum-member', // EnumMember
|
|
77
|
+
21: 'symbol-constant', // Constant
|
|
78
|
+
22: 'symbol-struct', // Struct
|
|
79
|
+
23: 'symbol-event', // Event
|
|
80
|
+
24: 'symbol-operator', // Operator
|
|
81
|
+
25: 'symbol-type-parameter' // TypeParameter
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const kindLabels: Record<number, string> = {
|
|
85
|
+
1: 'Text',
|
|
86
|
+
2: 'Method',
|
|
87
|
+
3: 'Function',
|
|
88
|
+
4: 'Constructor',
|
|
89
|
+
5: 'Field',
|
|
90
|
+
6: 'Variable',
|
|
91
|
+
7: 'Class',
|
|
92
|
+
8: 'Interface',
|
|
93
|
+
9: 'Module',
|
|
94
|
+
10: 'Property',
|
|
95
|
+
11: 'Unit',
|
|
96
|
+
12: 'Value',
|
|
97
|
+
13: 'Enum',
|
|
98
|
+
14: 'Keyword',
|
|
99
|
+
15: 'Snippet',
|
|
100
|
+
16: 'Color',
|
|
101
|
+
17: 'File',
|
|
102
|
+
18: 'Reference',
|
|
103
|
+
19: 'Folder',
|
|
104
|
+
20: 'EnumMember',
|
|
105
|
+
21: 'Constant',
|
|
106
|
+
22: 'Struct',
|
|
107
|
+
23: 'Event',
|
|
108
|
+
24: 'Operator',
|
|
109
|
+
25: 'TypeParameter'
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
function getKindIcon(kind?: number): string {
|
|
113
|
+
return kindIcons[kind ?? 1] ?? 'symbol-misc';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function getKindLabel(kind?: number): string {
|
|
117
|
+
return kindLabels[kind ?? 1] ?? 'Unknown';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function handleKeyDown(e: KeyboardEvent) {
|
|
121
|
+
switch (e.key) {
|
|
122
|
+
case 'ArrowUp':
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
const prevIndex = selectedIndex > 0 ? selectedIndex - 1 : items.length - 1;
|
|
125
|
+
onSelectionChange?.(prevIndex);
|
|
126
|
+
break;
|
|
127
|
+
case 'ArrowDown':
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
const nextIndex = selectedIndex < items.length - 1 ? selectedIndex + 1 : 0;
|
|
130
|
+
onSelectionChange?.(nextIndex);
|
|
131
|
+
break;
|
|
132
|
+
case 'Enter':
|
|
133
|
+
case 'Tab':
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
if (items[selectedIndex]) {
|
|
136
|
+
onSelect(items[selectedIndex]);
|
|
137
|
+
}
|
|
138
|
+
break;
|
|
139
|
+
case 'Escape':
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
onDismiss();
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function handleItemClick(item: CompletionItem, index: number) {
|
|
147
|
+
onSelectionChange?.(index);
|
|
148
|
+
onSelect(item);
|
|
149
|
+
}
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<svelte:window onkeydown={handleKeyDown} />
|
|
153
|
+
|
|
154
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
155
|
+
<div
|
|
156
|
+
class="autocomplete-widget {className}"
|
|
157
|
+
style="left: {position.x}px; top: {position.y}px; max-height: {maxHeight}px;"
|
|
158
|
+
role="listbox"
|
|
159
|
+
aria-label="Completions"
|
|
160
|
+
>
|
|
161
|
+
<div class="autocomplete-widget__list" bind:this={listRef}>
|
|
162
|
+
{#each items as item, i}
|
|
163
|
+
<button
|
|
164
|
+
class="autocomplete-widget__item"
|
|
165
|
+
class:autocomplete-widget__item--selected={i === selectedIndex}
|
|
166
|
+
class:autocomplete-widget__item--deprecated={item.tags?.includes(2)}
|
|
167
|
+
role="option"
|
|
168
|
+
aria-selected={i === selectedIndex}
|
|
169
|
+
onclick={() => handleItemClick(item, i)}
|
|
170
|
+
onmouseenter={() => onSelectionChange?.(i)}
|
|
171
|
+
>
|
|
172
|
+
<span
|
|
173
|
+
class="autocomplete-widget__icon autocomplete-widget__icon--{getKindIcon(item.kind)}"
|
|
174
|
+
title={getKindLabel(item.kind)}
|
|
175
|
+
>
|
|
176
|
+
{@html getKindSVG(item.kind)}
|
|
177
|
+
</span>
|
|
178
|
+
<span class="autocomplete-widget__label">
|
|
179
|
+
{item.label}
|
|
180
|
+
{#if item.labelDetails?.detail}
|
|
181
|
+
<span class="autocomplete-widget__label-detail">{item.labelDetails.detail}</span>
|
|
182
|
+
{/if}
|
|
183
|
+
</span>
|
|
184
|
+
{#if item.detail}
|
|
185
|
+
<span class="autocomplete-widget__detail">{item.detail}</span>
|
|
186
|
+
{/if}
|
|
187
|
+
</button>
|
|
188
|
+
{/each}
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
<!-- Documentation preview for selected item -->
|
|
192
|
+
{#if items[selectedIndex]?.documentation}
|
|
193
|
+
<div class="autocomplete-widget__docs">
|
|
194
|
+
{#if typeof items[selectedIndex].documentation === 'string'}
|
|
195
|
+
<pre>{items[selectedIndex].documentation}</pre>
|
|
196
|
+
{:else if items[selectedIndex].documentation?.kind === 'markdown'}
|
|
197
|
+
<div class="autocomplete-widget__docs-markdown">
|
|
198
|
+
{items[selectedIndex].documentation.value}
|
|
199
|
+
</div>
|
|
200
|
+
{:else}
|
|
201
|
+
<pre>{items[selectedIndex].documentation?.value}</pre>
|
|
202
|
+
{/if}
|
|
203
|
+
</div>
|
|
204
|
+
{/if}
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<script context="module" lang="ts">
|
|
208
|
+
// SVG icons for completion item kinds
|
|
209
|
+
function getKindSVG(kind?: number): string {
|
|
210
|
+
const icons: Record<number, string> = {
|
|
211
|
+
2: '<path d="M4 4h4v2H4v4H2V4h2zm10 0h2v6h-4V8h2V4zm-6 8h4v4H8v-4zm8 0h2v4h-4v-2h2v-2z" fill="currentColor"/>',
|
|
212
|
+
3: '<path d="M4 4h8v2H4v8H2V4h2zm6 4h4v8h-2v-6H8V8h2z" fill="currentColor"/>',
|
|
213
|
+
6: '<path d="M4 4h8v4H8V6H6v4H4V4zm0 8h2v4H4v-4zm4 0h8v4H8v-4z" fill="currentColor"/>',
|
|
214
|
+
7: '<path d="M4 4h8v2H4v8H2V4h2zm4 4h6v8H6V8h2zm2 2v4h2v-4h-2z" fill="currentColor"/>',
|
|
215
|
+
8: '<path d="M6 4h8v2H6v8H4V4h2zm6 4h2v8H8v-2h4V8z" fill="currentColor"/>',
|
|
216
|
+
9: '<path d="M2 4h4v2H2v8h8v2H2V4zm6 2h8v10H8V6zm2 2v6h4V8h-4z" fill="currentColor"/>',
|
|
217
|
+
13: '<path d="M4 4h8v2H4v8H2V4h2zm4 4h6v8H6V8h2zm2 2v2h2v-2h-2z" fill="currentColor"/>',
|
|
218
|
+
14: '<path d="M4 6h10v2H4v6H2V6h2zm4 4h6v6H6v-6h2zm2 2v2h2v-2h-2z" fill="currentColor"/>',
|
|
219
|
+
15: '<path d="M4 4v12h12V4H4zm2 2h8v8H6V6z" fill="currentColor"/>',
|
|
220
|
+
21: '<path d="M8 2l6 6-6 6-6-6 6-6zm0 2.83L4.83 8 8 11.17 11.17 8 8 4.83z" fill="currentColor"/>'
|
|
221
|
+
};
|
|
222
|
+
return `<svg viewBox="0 0 16 16" width="16" height="16">${icons[kind ?? 1] ?? '<circle cx="8" cy="8" r="4" fill="currentColor"/>'}</svg>`;
|
|
223
|
+
}
|
|
224
|
+
</script>
|
|
225
|
+
|
|
226
|
+
<style>
|
|
227
|
+
.autocomplete-widget {
|
|
228
|
+
position: fixed;
|
|
229
|
+
z-index: 1000;
|
|
230
|
+
background: var(--ide-bg-secondary);
|
|
231
|
+
border: 1px solid var(--ide-border);
|
|
232
|
+
border-radius: var(--ide-radius-md);
|
|
233
|
+
box-shadow: var(--ide-shadow-lg);
|
|
234
|
+
overflow: hidden;
|
|
235
|
+
display: flex;
|
|
236
|
+
min-width: 300px;
|
|
237
|
+
max-width: 500px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.autocomplete-widget__list {
|
|
241
|
+
flex: 1;
|
|
242
|
+
overflow-y: auto;
|
|
243
|
+
max-height: inherit;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.autocomplete-widget__item {
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
gap: var(--ide-spacing-sm);
|
|
250
|
+
width: 100%;
|
|
251
|
+
padding: var(--ide-spacing-xs) var(--ide-spacing-sm);
|
|
252
|
+
background: transparent;
|
|
253
|
+
border: none;
|
|
254
|
+
font: inherit;
|
|
255
|
+
font-size: var(--ide-font-size-sm);
|
|
256
|
+
color: var(--ide-text-primary);
|
|
257
|
+
text-align: left;
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
transition: background var(--ide-transition-fast);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.autocomplete-widget__item:hover,
|
|
263
|
+
.autocomplete-widget__item--selected {
|
|
264
|
+
background: var(--ide-bg-hover);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.autocomplete-widget__item--selected {
|
|
268
|
+
background: var(--ide-interactive);
|
|
269
|
+
color: white;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.autocomplete-widget__item--deprecated {
|
|
273
|
+
text-decoration: line-through;
|
|
274
|
+
opacity: 0.7;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.autocomplete-widget__icon {
|
|
278
|
+
display: flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
justify-content: center;
|
|
281
|
+
width: 16px;
|
|
282
|
+
height: 16px;
|
|
283
|
+
flex-shrink: 0;
|
|
284
|
+
color: var(--ide-text-secondary);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.autocomplete-widget__item--selected .autocomplete-widget__icon {
|
|
288
|
+
color: inherit;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.autocomplete-widget__icon :global(svg) {
|
|
292
|
+
width: 100%;
|
|
293
|
+
height: 100%;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.autocomplete-widget__label {
|
|
297
|
+
flex: 1;
|
|
298
|
+
overflow: hidden;
|
|
299
|
+
text-overflow: ellipsis;
|
|
300
|
+
white-space: nowrap;
|
|
301
|
+
font-family: var(--ide-font-mono);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.autocomplete-widget__label-detail {
|
|
305
|
+
opacity: 0.7;
|
|
306
|
+
margin-left: var(--ide-spacing-xs);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.autocomplete-widget__detail {
|
|
310
|
+
flex-shrink: 0;
|
|
311
|
+
font-size: var(--ide-font-size-xs);
|
|
312
|
+
color: var(--ide-text-muted);
|
|
313
|
+
max-width: 150px;
|
|
314
|
+
overflow: hidden;
|
|
315
|
+
text-overflow: ellipsis;
|
|
316
|
+
white-space: nowrap;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.autocomplete-widget__item--selected .autocomplete-widget__detail {
|
|
320
|
+
color: inherit;
|
|
321
|
+
opacity: 0.8;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.autocomplete-widget__docs {
|
|
325
|
+
width: 300px;
|
|
326
|
+
max-height: inherit;
|
|
327
|
+
overflow-y: auto;
|
|
328
|
+
padding: var(--ide-spacing-sm);
|
|
329
|
+
border-left: 1px solid var(--ide-border);
|
|
330
|
+
background: var(--ide-bg-tertiary);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.autocomplete-widget__docs pre {
|
|
334
|
+
margin: 0;
|
|
335
|
+
font-family: var(--ide-font-mono);
|
|
336
|
+
font-size: var(--ide-font-size-xs);
|
|
337
|
+
white-space: pre-wrap;
|
|
338
|
+
word-break: break-word;
|
|
339
|
+
color: var(--ide-text-secondary);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.autocomplete-widget__docs-markdown {
|
|
343
|
+
font-size: var(--ide-font-size-xs);
|
|
344
|
+
color: var(--ide-text-secondary);
|
|
345
|
+
line-height: 1.5;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* Scrollbar styling */
|
|
349
|
+
.autocomplete-widget__list::-webkit-scrollbar,
|
|
350
|
+
.autocomplete-widget__docs::-webkit-scrollbar {
|
|
351
|
+
width: 8px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.autocomplete-widget__list::-webkit-scrollbar-track,
|
|
355
|
+
.autocomplete-widget__docs::-webkit-scrollbar-track {
|
|
356
|
+
background: transparent;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.autocomplete-widget__list::-webkit-scrollbar-thumb,
|
|
360
|
+
.autocomplete-widget__docs::-webkit-scrollbar-thumb {
|
|
361
|
+
background: var(--ide-scrollbar-thumb);
|
|
362
|
+
border-radius: 4px;
|
|
363
|
+
}
|
|
364
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AutocompleteWidget - LSP completion suggestions dropdown
|
|
3
|
+
*
|
|
4
|
+
* Displays completion items from the language server with:
|
|
5
|
+
* - Item kind icons
|
|
6
|
+
* - Labels and details
|
|
7
|
+
* - Documentation preview
|
|
8
|
+
* - Keyboard navigation
|
|
9
|
+
*/
|
|
10
|
+
import type { CompletionItem } from '../../types/lsp';
|
|
11
|
+
interface Props {
|
|
12
|
+
/** Completion items to display */
|
|
13
|
+
items: CompletionItem[];
|
|
14
|
+
/** Currently selected index */
|
|
15
|
+
selectedIndex?: number;
|
|
16
|
+
/** Position to render the widget */
|
|
17
|
+
position: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
/** Maximum height before scrolling */
|
|
22
|
+
maxHeight?: number;
|
|
23
|
+
/** Called when an item is selected */
|
|
24
|
+
onSelect: (item: CompletionItem) => void;
|
|
25
|
+
/** Called when widget should close */
|
|
26
|
+
onDismiss: () => void;
|
|
27
|
+
/** Called when selection changes */
|
|
28
|
+
onSelectionChange?: (index: number) => void;
|
|
29
|
+
class?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const AutocompleteWidget: import("svelte").Component<Props, {}, "">;
|
|
32
|
+
type AutocompleteWidget = ReturnType<typeof AutocompleteWidget>;
|
|
33
|
+
export default AutocompleteWidget;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* DiagnosticMarker - Inline diagnostic indicator
|
|
4
|
+
*
|
|
5
|
+
* Renders squiggly underlines and gutter icons for diagnostics
|
|
6
|
+
* at specific positions in the editor.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { Diagnostic, DiagnosticSeverity } from '../../types/lsp';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
/** The diagnostic to display */
|
|
13
|
+
diagnostic: Diagnostic;
|
|
14
|
+
/** Whether this is a gutter marker or inline underline */
|
|
15
|
+
type?: 'gutter' | 'inline';
|
|
16
|
+
/** Called when marker is clicked */
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
class?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
diagnostic,
|
|
23
|
+
type = 'inline',
|
|
24
|
+
onClick,
|
|
25
|
+
class: className = ''
|
|
26
|
+
}: Props = $props();
|
|
27
|
+
|
|
28
|
+
function getSeverityClass(severity?: DiagnosticSeverity): string {
|
|
29
|
+
switch (severity) {
|
|
30
|
+
case 1: return 'error';
|
|
31
|
+
case 2: return 'warning';
|
|
32
|
+
case 3: return 'info';
|
|
33
|
+
case 4: return 'hint';
|
|
34
|
+
default: return 'info';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getSeverityLabel(severity?: DiagnosticSeverity): string {
|
|
39
|
+
switch (severity) {
|
|
40
|
+
case 1: return 'Error';
|
|
41
|
+
case 2: return 'Warning';
|
|
42
|
+
case 3: return 'Info';
|
|
43
|
+
case 4: return 'Hint';
|
|
44
|
+
default: return 'Diagnostic';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
{#if type === 'gutter'}
|
|
50
|
+
<button
|
|
51
|
+
class="diagnostic-gutter diagnostic-gutter--{getSeverityClass(diagnostic.severity)} {className}"
|
|
52
|
+
title="{getSeverityLabel(diagnostic.severity)}: {diagnostic.message}"
|
|
53
|
+
onclick={onClick}
|
|
54
|
+
aria-label="{getSeverityLabel(diagnostic.severity)} on line {diagnostic.range.start.line + 1}"
|
|
55
|
+
>
|
|
56
|
+
{@html getGutterIcon(diagnostic.severity)}
|
|
57
|
+
</button>
|
|
58
|
+
{:else}
|
|
59
|
+
<span
|
|
60
|
+
class="diagnostic-inline diagnostic-inline--{getSeverityClass(diagnostic.severity)} {className}"
|
|
61
|
+
title="{getSeverityLabel(diagnostic.severity)}: {diagnostic.message}"
|
|
62
|
+
role="button"
|
|
63
|
+
tabindex="0"
|
|
64
|
+
onclick={onClick}
|
|
65
|
+
onkeydown={(e) => e.key === 'Enter' && onClick?.()}
|
|
66
|
+
></span>
|
|
67
|
+
{/if}
|
|
68
|
+
|
|
69
|
+
<script context="module" lang="ts">
|
|
70
|
+
function getGutterIcon(severity?: number): string {
|
|
71
|
+
const color = severity === 1 ? 'var(--ide-error)' :
|
|
72
|
+
severity === 2 ? 'var(--ide-warning)' :
|
|
73
|
+
severity === 3 ? 'var(--ide-info)' :
|
|
74
|
+
'var(--ide-text-muted)';
|
|
75
|
+
|
|
76
|
+
switch (severity) {
|
|
77
|
+
case 1: // Error - filled circle with X
|
|
78
|
+
return `<svg viewBox="0 0 16 16" width="12" height="12">
|
|
79
|
+
<circle cx="8" cy="8" r="6" fill="${color}"/>
|
|
80
|
+
<path d="M5.5 5.5l5 5M10.5 5.5l-5 5" stroke="var(--ide-bg-primary)" stroke-width="1.5" stroke-linecap="round"/>
|
|
81
|
+
</svg>`;
|
|
82
|
+
case 2: // Warning - triangle
|
|
83
|
+
return `<svg viewBox="0 0 16 16" width="12" height="12">
|
|
84
|
+
<path d="M8 2L1 14h14L8 2z" fill="${color}"/>
|
|
85
|
+
<path d="M8 6v4M8 12v1" stroke="var(--ide-bg-primary)" stroke-width="1.5" stroke-linecap="round"/>
|
|
86
|
+
</svg>`;
|
|
87
|
+
case 3: // Info - circle with i
|
|
88
|
+
return `<svg viewBox="0 0 16 16" width="12" height="12">
|
|
89
|
+
<circle cx="8" cy="8" r="6" fill="${color}"/>
|
|
90
|
+
<path d="M8 5v1M8 8v4" stroke="var(--ide-bg-primary)" stroke-width="1.5" stroke-linecap="round"/>
|
|
91
|
+
</svg>`;
|
|
92
|
+
case 4: // Hint - lightbulb outline
|
|
93
|
+
return `<svg viewBox="0 0 16 16" width="12" height="12">
|
|
94
|
+
<path d="M8 1a5 5 0 013 9v2a1 1 0 01-1 1H6a1 1 0 01-1-1v-2a5 5 0 013-9z" fill="none" stroke="${color}" stroke-width="1.2"/>
|
|
95
|
+
<path d="M6 14h4" stroke="${color}" stroke-width="1.2" stroke-linecap="round"/>
|
|
96
|
+
</svg>`;
|
|
97
|
+
default:
|
|
98
|
+
return `<svg viewBox="0 0 16 16" width="12" height="12">
|
|
99
|
+
<circle cx="8" cy="8" r="4" fill="${color}"/>
|
|
100
|
+
</svg>`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style>
|
|
106
|
+
.diagnostic-gutter {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
width: 16px;
|
|
111
|
+
height: 16px;
|
|
112
|
+
padding: 0;
|
|
113
|
+
border: none;
|
|
114
|
+
background: transparent;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
transition: transform var(--ide-transition-fast);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.diagnostic-gutter:hover {
|
|
120
|
+
transform: scale(1.15);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.diagnostic-gutter:focus-visible {
|
|
124
|
+
outline: 2px solid var(--ide-interactive);
|
|
125
|
+
outline-offset: 1px;
|
|
126
|
+
border-radius: 2px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.diagnostic-inline {
|
|
130
|
+
position: relative;
|
|
131
|
+
display: inline;
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.diagnostic-inline::after {
|
|
136
|
+
content: '';
|
|
137
|
+
position: absolute;
|
|
138
|
+
left: 0;
|
|
139
|
+
right: 0;
|
|
140
|
+
bottom: 0;
|
|
141
|
+
height: 2px;
|
|
142
|
+
background-repeat: repeat-x;
|
|
143
|
+
background-size: 4px 2px;
|
|
144
|
+
background-position: bottom;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.diagnostic-inline--error::after {
|
|
148
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='2'%3E%3Cpath d='M0 2 L1 0 L2 2 L3 0 L4 2' stroke='%23f44336' fill='none' stroke-width='0.5'/%3E%3C/svg%3E");
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.diagnostic-inline--warning::after {
|
|
152
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='2'%3E%3Cpath d='M0 2 L1 0 L2 2 L3 0 L4 2' stroke='%23ff9800' fill='none' stroke-width='0.5'/%3E%3C/svg%3E");
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.diagnostic-inline--info::after {
|
|
156
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='2'%3E%3Cpath d='M0 2 L1 0 L2 2 L3 0 L4 2' stroke='%232196f3' fill='none' stroke-width='0.5'/%3E%3C/svg%3E");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.diagnostic-inline--hint::after {
|
|
160
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='2'%3E%3Cpath d='M0 2 L1 0 L2 2 L3 0 L4 2' stroke='%239e9e9e' fill='none' stroke-width='0.5'/%3E%3C/svg%3E");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.diagnostic-inline:hover::after {
|
|
164
|
+
height: 3px;
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiagnosticMarker - Inline diagnostic indicator
|
|
3
|
+
*
|
|
4
|
+
* Renders squiggly underlines and gutter icons for diagnostics
|
|
5
|
+
* at specific positions in the editor.
|
|
6
|
+
*/
|
|
7
|
+
import type { Diagnostic } from '../../types/lsp';
|
|
8
|
+
interface Props {
|
|
9
|
+
/** The diagnostic to display */
|
|
10
|
+
diagnostic: Diagnostic;
|
|
11
|
+
/** Whether this is a gutter marker or inline underline */
|
|
12
|
+
type?: 'gutter' | 'inline';
|
|
13
|
+
/** Called when marker is clicked */
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
class?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const DiagnosticMarker: import("svelte").Component<Props, {}, "">;
|
|
18
|
+
type DiagnosticMarker = ReturnType<typeof DiagnosticMarker>;
|
|
19
|
+
export default DiagnosticMarker;
|