mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
lsp: Handle selections and highlighting in the LSP
Ask the interpreter for all the necessary information, but handle the look and feel in the LSP preview UI.
This commit is contained in:
parent
c9414d98fa
commit
ca1263c3e5
9 changed files with 324 additions and 632 deletions
|
@ -5,7 +5,7 @@ use std::io::Read;
|
|||
use std::path::{Path, PathBuf};
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::parser::{TextRange, TextSize};
|
||||
use crate::parser::TextSize;
|
||||
|
||||
/// Span represent an error location within a file.
|
||||
///
|
||||
|
@ -114,16 +114,6 @@ impl SourceFileInner {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn text_range_to_file_line_column(
|
||||
&self,
|
||||
range: TextRange,
|
||||
) -> (String, usize, usize, usize, usize) {
|
||||
let file_name = self.path().to_string_lossy().to_string();
|
||||
let (start_line, start_column) = self.line_column(range.start().into());
|
||||
let (end_line, end_column) = self.line_column(range.end().into());
|
||||
(file_name, start_line, start_column, end_line, end_column)
|
||||
}
|
||||
|
||||
pub fn text_size_to_file_line_column(
|
||||
&self,
|
||||
size: TextSize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue