Make codemirror tooltips selectable. (#3149)
Co-authored-by: Paul Tagliamonte <paul@zoo.dev> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
This commit is contained in:
@ -1,5 +1,10 @@
|
|||||||
import { Extension } from '@codemirror/state'
|
import { Extension } from '@codemirror/state'
|
||||||
import { hoverTooltip, tooltips, ViewPlugin } from '@codemirror/view'
|
import {
|
||||||
|
hoverTooltip,
|
||||||
|
tooltips,
|
||||||
|
ViewPlugin,
|
||||||
|
EditorView,
|
||||||
|
} from '@codemirror/view'
|
||||||
|
|
||||||
import { LanguageServerPlugin } from './lsp'
|
import { LanguageServerPlugin } from './lsp'
|
||||||
import { offsetToPos } from './util'
|
import { offsetToPos } from './util'
|
||||||
@ -17,6 +22,13 @@ export default function lspHoverExt(
|
|||||||
}),
|
}),
|
||||||
tooltips({
|
tooltips({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
parent: document.body,
|
||||||
|
}),
|
||||||
|
EditorView.baseTheme({
|
||||||
|
'.cm-tooltip': {
|
||||||
|
fontSize: '12px',
|
||||||
|
maxWidth: '400px',
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user