Implement toggle-comments
This commit is contained in:
parent
2e2bce7322
commit
f0db748ba1
5 changed files with 198 additions and 7 deletions
|
@ -14,6 +14,7 @@ pub struct LanguageConfig {
|
|||
pub name: String,
|
||||
pub path_suffixes: Vec<String>,
|
||||
pub brackets: Vec<BracketPair>,
|
||||
pub line_comment: Option<String>,
|
||||
pub language_server: Option<LanguageServerConfig>,
|
||||
}
|
||||
|
||||
|
@ -115,6 +116,10 @@ impl Language {
|
|||
self.config.name.as_str()
|
||||
}
|
||||
|
||||
pub fn line_comment_prefix(&self) -> Option<&str> {
|
||||
self.config.line_comment.as_deref()
|
||||
}
|
||||
|
||||
pub fn start_server(
|
||||
&self,
|
||||
root_path: &Path,
|
||||
|
|
|
@ -1654,11 +1654,6 @@ impl Snapshot {
|
|||
None
|
||||
}
|
||||
|
||||
fn is_line_blank(&self, row: u32) -> bool {
|
||||
self.text_for_range(Point::new(row, 0)..Point::new(row, self.line_len(row)))
|
||||
.all(|chunk| chunk.matches(|c: char| !c.is_whitespace()).next().is_none())
|
||||
}
|
||||
|
||||
pub fn chunks<'a, T: ToOffset>(
|
||||
&'a self,
|
||||
range: Range<T>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue