-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement more complex completion item * Add more completion kinds * Add support for snippets * clippy * remove non rendered text * Add primitive overload resolution * clippy * improve overloaded format * Re-add detail to standard completion item * Make label and insertion text different * fmt * fix tests * Remove items method and make local arena private again * Refactor completion * Add 'all' case * Implement changes in server * remove obsolete change * Refactor to AnyEnt instead of ID * Remove obsolete get_end function * Fix unpredictable text order * Fix: All should use the Completion item kind 'keyword' * Reduce code duplication * rustify PortsOrGenericsExtractor * Remove unused function * Refactor for any keyword and use function instead of text * Conditional snippet support * Don't complete when the last token is not a left par or comma * Also complete with an identifier on the right hand side * Refactor: standalone functions from methods * Remove serde dependency from vhdl_lang * clippy * symmetry in docstring
- Loading branch information
1 parent
4732a6c
commit c84e06b
Showing
10 changed files
with
592 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,11 @@ | |
// | ||
// Copyright (c) 2018, Olof Kraigher [email protected] | ||
|
||
use crate::analysis::{AnyEnt, DesignRoot, EntRef}; | ||
use crate::analysis::{AnyEnt, CompletionItem, DesignRoot, EntRef}; | ||
use crate::ast::DesignFile; | ||
use crate::config::Config; | ||
use crate::syntax::VHDLParser; | ||
use crate::{data::*, EntHierarchy}; | ||
use crate::{data::*, EntHierarchy, EntityId}; | ||
use fnv::{FnvHashMap, FnvHashSet}; | ||
use std::collections::hash_map::Entry; | ||
use std::path::{Path, PathBuf}; | ||
|
@@ -278,6 +278,11 @@ impl Project { | |
self.root.format_declaration(ent) | ||
} | ||
|
||
pub fn format_entity(&self, id: EntityId) -> Option<String> { | ||
let ent = self.root.get_ent(id); | ||
self.format_declaration(ent) | ||
} | ||
|
||
/// Search for all references to the declaration at decl_pos | ||
pub fn find_all_references(&self, ent: &AnyEnt) -> Vec<SrcPos> { | ||
self.root.find_all_references(ent) | ||
|
@@ -293,7 +298,11 @@ impl Project { | |
self.files.values() | ||
} | ||
|
||
pub fn list_completion_options(&self, source: &Source, cursor: Position) -> Vec<String> { | ||
pub fn list_completion_options( | ||
&self, | ||
source: &Source, | ||
cursor: Position, | ||
) -> Vec<CompletionItem> { | ||
self.root.list_completion_options(source, cursor) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.