Skip to content

Commit

Permalink
Merge pull request #16 from cristianoliveira/fix/issue-suggesting-mid…
Browse files Browse the repository at this point in the history
…dle-of-tags

fix: issue suggesting in beetween other hx-* tags
  • Loading branch information
ThePrimeagen committed Sep 15, 2023
2 parents 5e96e39 + d0dc066 commit 0e2400d
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 140 deletions.
2 changes: 1 addition & 1 deletion lsp/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ mod tests {
},
"position": {
"line": 0,
"character": 17
"character": 13
}
}),
};
Expand Down
2 changes: 1 addition & 1 deletion lsp/src/htmx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl TryFrom<&(PathBuf, String)> for HxCompletion {
pub fn hx_completion(text_params: TextDocumentPositionParams) -> Option<Vec<HxCompletion>> {
let result = crate::tree_sitter::get_position_from_lsp_completion(text_params.clone())?;

error!("result: {:?} params: {:?}", result, text_params);
debug!("result: {:?} params: {:?}", result, text_params);

match result {
Position::AttributeName(name) => {
Expand Down
7 changes: 2 additions & 5 deletions lsp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod handle;
mod htmx;
mod text_store;
mod tree_sitter;
mod tree_sitter_querier;

use anyhow::Result;
use htmx::HxCompletion;
Expand Down Expand Up @@ -129,11 +130,7 @@ pub fn start_lsp() -> Result<()> {
text_document_sync: Some(TextDocumentSyncCapability::Kind(TextDocumentSyncKind::FULL)),
completion_provider: Some(lsp_types::CompletionOptions {
resolve_provider: Some(false),
trigger_characters: Some(vec![
"-".to_string(),
"\"".to_string(),
" ".to_string(),
]),
trigger_characters: Some(vec!["-".to_string(), "\"".to_string(), " ".to_string()]),
work_done_progress_options: WorkDoneProgressOptions {
work_done_progress: None,
},
Expand Down
Loading

0 comments on commit 0e2400d

Please sign in to comment.