chore: were spellcecked nauw (#3887)
CI / Formatting and spellchecking (push) Has been cancelled
CI / Clippy on macos-latest (push) Has been cancelled
CI / Clippy on ubuntu-latest (push) Has been cancelled
CI / Clippy on windows-latest (push) Has been cancelled
CI / Rust on macos-latest (push) Has been cancelled
CI / Rust on ubuntu-latest (push) Has been cancelled
CI / Rust on windows-latest (push) Has been cancelled
CI / Formatting and spellchecking (push) Has been cancelled
CI / Clippy on macos-latest (push) Has been cancelled
CI / Clippy on ubuntu-latest (push) Has been cancelled
CI / Clippy on windows-latest (push) Has been cancelled
CI / Rust on macos-latest (push) Has been cancelled
CI / Rust on ubuntu-latest (push) Has been cancelled
CI / Rust on windows-latest (push) Has been cancelled
using crate-ci/typos
This commit is contained in:
@@ -74,7 +74,7 @@ jobs:
|
||||
run: cargo test --profile ci --doc --workspace
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
name: Formatting and spellchecking
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
@@ -87,6 +87,9 @@ jobs:
|
||||
- name: Run rustfmt
|
||||
run: cargo fmt --all --check
|
||||
|
||||
- name: Spell Check Repo
|
||||
uses: crate-ci/typos@02ea592e44b3a53c302f697cddca7641cd051c3d
|
||||
|
||||
clippy:
|
||||
name: Clippy on ${{ matrix.os }}
|
||||
strategy:
|
||||
|
||||
+2
-2
@@ -81,7 +81,7 @@
|
||||
### Features/Changes
|
||||
|
||||
- Add fedora builds
|
||||
- Finish tree sitter dynamic libary support by downloading from https://github.com/lapce/tree-sitter-grammars
|
||||
- Finish tree sitter dynamic library support by downloading from https://github.com/lapce/tree-sitter-grammars
|
||||
- Saves scale configuration in settings to restore at startup
|
||||
- text in ui can be selected and copied
|
||||
- add right click context menu for editor tab
|
||||
@@ -318,7 +318,7 @@
|
||||
- [#1459](https://github.com/lapce/lapce/pull/1459): Fix opening currently used logfile
|
||||
- [#1505](https://github.com/lapce/lapce/pull/1505): Fix proxy download for hosts with curl without -Z flag
|
||||
- [#1483](https://github.com/lapce/lapce/pull/1483): Fix showing the close icon for the first tab when opening multiple tab
|
||||
- [#1477](https://github.com/lapce/lapce/pull/1477): Now use `esc` to close searchbar regarless of the current focus
|
||||
- [#1477](https://github.com/lapce/lapce/pull/1477): Now use `esc` to close searchbar regardless of the current focus
|
||||
- [#1507](https://github.com/lapce/lapce/pull/1507): Fixed a crash when scratch buffer is closed
|
||||
- [#1547](https://github.com/lapce/lapce/pull/1547): Fix infinite cycle in workspace symbol search
|
||||
- [#1628](https://github.com/lapce/lapce/pull/1541): Fix kts files not being recognized
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
# https://github.com/crate-ci/typos/blob/02ea592e44b3a53c302f697cddca7641cd051c3d/docs/reference.md
|
||||
|
||||
[files]
|
||||
|
||||
[default]
|
||||
extend-ignore-re = [
|
||||
# Ignore lines that end with `# spellchecker:disable-line`
|
||||
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
|
||||
# Ignore the line after `# spellchecker:ignore-next-line`:
|
||||
"(#|//)\\s*spellchecker:ignore-next-line\\n.*",
|
||||
# Ignore blocks between `# spellchecker:off` and `# spellchecker:on`
|
||||
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
|
||||
]
|
||||
|
||||
[default.extend-identifiers]
|
||||
|
||||
[default.extend-words]
|
||||
@@ -82,7 +82,7 @@ default = {}
|
||||
# [terminal.profiles.example]
|
||||
# command = "cargo"
|
||||
# arguments = ["run"]
|
||||
# environemnt = { "KEY" = "VALUE" }
|
||||
# environment = { "KEY" = "VALUE" }
|
||||
# workdir = "/home/user"
|
||||
|
||||
[ui]
|
||||
|
||||
@@ -308,7 +308,7 @@ impl AppData {
|
||||
) -> floem::Application {
|
||||
let mut app = floem::Application::new();
|
||||
|
||||
let mut inital_windows = 0;
|
||||
let mut initial_windows = 0;
|
||||
|
||||
// Split user input into known existing directors and
|
||||
// file paths that exist or not
|
||||
@@ -376,7 +376,7 @@ impl AppData {
|
||||
move |window_id| app_data.app_view(window_id, info, files),
|
||||
Some(config),
|
||||
);
|
||||
inital_windows += 1;
|
||||
initial_windows += 1;
|
||||
}
|
||||
} else if files.is_none() {
|
||||
// There were no dirs and no files specified, so we'll load the last windows
|
||||
@@ -401,7 +401,7 @@ impl AppData {
|
||||
},
|
||||
Some(config),
|
||||
);
|
||||
inital_windows += 1;
|
||||
initial_windows += 1;
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
@@ -410,7 +410,7 @@ impl AppData {
|
||||
}
|
||||
}
|
||||
|
||||
if inital_windows == 0 {
|
||||
if initial_windows == 0 {
|
||||
let mut info = db.get_window().unwrap_or_else(|_| WindowInfo {
|
||||
size: Size::new(800.0, 600.0),
|
||||
pos: Point::ZERO,
|
||||
@@ -2832,7 +2832,7 @@ fn palette(window_tab_data: Rc<WindowTabData>) -> impl View {
|
||||
.items_center()
|
||||
.pointer_events_none()
|
||||
})
|
||||
.debug_name("Pallete Layer")
|
||||
.debug_name("Palette Layer")
|
||||
}
|
||||
|
||||
fn window_message_view(
|
||||
@@ -3909,8 +3909,8 @@ pub fn launch() {
|
||||
for (_, window) in app_data.windows.get_untracked() {
|
||||
for (_, tab) in window.window_tabs.get_untracked() {
|
||||
for (_, doc) in tab.main_split.docs.get_untracked() {
|
||||
doc.syntax.update(|syntaxt| {
|
||||
*syntaxt = Syntax::from_language(syntaxt.language);
|
||||
doc.syntax.update(|syntax| {
|
||||
*syntax = Syntax::from_language(syntax.language);
|
||||
});
|
||||
doc.trigger_syntax_change(None);
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ impl DapData {
|
||||
let variables_id = self.variables_id;
|
||||
|
||||
let send = create_ext_action(self.common.scope, move |result| {
|
||||
if let Ok(ProxyResponse::DapVariableResponse { varialbes }) = result {
|
||||
if let Ok(ProxyResponse::DapVariableResponse { variables }) = result {
|
||||
variables_id.update(|id| {
|
||||
*id += 1;
|
||||
});
|
||||
@@ -370,7 +370,7 @@ impl DapData {
|
||||
let mut new_parent = parent.clone();
|
||||
new_parent.push(reference);
|
||||
var.read = true;
|
||||
var.children = varialbes
|
||||
var.children = variables
|
||||
.into_iter()
|
||||
.map(|v| DapVariable {
|
||||
item: ScopeOrVar::Var(v),
|
||||
|
||||
@@ -111,7 +111,7 @@ pub struct DocHistory {
|
||||
pub enum DocContent {
|
||||
/// A file at some location. This can be a remote path.
|
||||
File { path: PathBuf, read_only: bool },
|
||||
/// A local document, which doens't need to be sync to the disk.
|
||||
/// A local document, which doesn't need to be sync to the disk.
|
||||
Local,
|
||||
/// A document of an old version in the source control
|
||||
History(DocHistory),
|
||||
@@ -1193,7 +1193,7 @@ impl Doc {
|
||||
// In normal typing, if we didn't do this, then the text would jitter forward and then
|
||||
// backwards as the completion lens is updated.
|
||||
// TODO: this could also handle simple deletion, but we don't currently keep track of
|
||||
// the past copmletion lens string content in the field.
|
||||
// the past completion lens string content in the field.
|
||||
if delta.as_simple_insert().is_some() {
|
||||
let (iv, new_len) = delta.summary();
|
||||
if iv.start() == iv.end()
|
||||
@@ -1331,13 +1331,13 @@ impl Doc {
|
||||
content, ..
|
||||
}) = result
|
||||
{
|
||||
let hisotry = DocumentHistory::new(
|
||||
let history = DocumentHistory::new(
|
||||
path.clone(),
|
||||
"head".to_string(),
|
||||
&content,
|
||||
);
|
||||
histories.update(|histories| {
|
||||
histories.insert("head".to_string(), hisotry);
|
||||
histories.insert("head".to_string(), history);
|
||||
});
|
||||
|
||||
doc.trigger_head_change();
|
||||
|
||||
@@ -1254,7 +1254,7 @@ impl EditorData {
|
||||
(start_position, position)
|
||||
});
|
||||
|
||||
enum DefinitionOrReferece {
|
||||
enum DefinitionOrReference {
|
||||
Location(EditorLocation),
|
||||
References(Vec<Location>),
|
||||
}
|
||||
@@ -1268,11 +1268,11 @@ impl EditorData {
|
||||
}
|
||||
|
||||
match d {
|
||||
DefinitionOrReferece::Location(location) => {
|
||||
DefinitionOrReference::Location(location) => {
|
||||
internal_command
|
||||
.send(InternalCommand::JumpToLocation { location });
|
||||
}
|
||||
DefinitionOrReferece::References(locations) => {
|
||||
DefinitionOrReference::References(locations) => {
|
||||
internal_command.send(InternalCommand::PaletteReferences {
|
||||
references: locations
|
||||
.into_iter()
|
||||
@@ -1333,7 +1333,7 @@ impl EditorData {
|
||||
}
|
||||
if references.len() == 1 {
|
||||
let location = &references[0];
|
||||
send(DefinitionOrReferece::Location(
|
||||
send(DefinitionOrReference::Location(
|
||||
EditorLocation {
|
||||
path: path_from_url(
|
||||
&location.uri,
|
||||
@@ -1349,7 +1349,7 @@ impl EditorData {
|
||||
},
|
||||
));
|
||||
} else {
|
||||
send(DefinitionOrReferece::References(
|
||||
send(DefinitionOrReference::References(
|
||||
references,
|
||||
));
|
||||
}
|
||||
@@ -1358,7 +1358,7 @@ impl EditorData {
|
||||
);
|
||||
} else {
|
||||
let path = path_from_url(&location.uri);
|
||||
send(DefinitionOrReferece::Location(EditorLocation {
|
||||
send(DefinitionOrReference::Location(EditorLocation {
|
||||
path,
|
||||
position: Some(EditorPosition::Position(
|
||||
location.range.start,
|
||||
@@ -1430,7 +1430,7 @@ impl EditorData {
|
||||
);
|
||||
}
|
||||
|
||||
pub fn find_refenrence(&self, window_tab_data: WindowTabData) {
|
||||
pub fn find_reference(&self, window_tab_data: WindowTabData) {
|
||||
let doc = self.doc();
|
||||
let path = match if doc.loaded() {
|
||||
doc.content.with_untracked(|c| c.path().cloned())
|
||||
|
||||
@@ -1424,9 +1424,9 @@ fn editor_gutter_breakpoint_view(
|
||||
});
|
||||
} else {
|
||||
let mut toggle_active = false;
|
||||
if let Some(breakpint) = breakpoints.get_mut(&line) {
|
||||
if !breakpint.active {
|
||||
breakpint.active = true;
|
||||
if let Some(breakpoint) = breakpoints.get_mut(&line) {
|
||||
if !breakpoint.active {
|
||||
breakpoint.active = true;
|
||||
toggle_active = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ impl FileExplorerData {
|
||||
let done = self
|
||||
.root
|
||||
.try_update(|root| {
|
||||
// the directories in which the file are located are all readed and opened
|
||||
// the directories in which the file are located are all read and opened
|
||||
if root.get_file_node(&path).is_some() {
|
||||
for current_path in path.ancestors() {
|
||||
if let Some(file) = root.get_file_node_mut(current_path) {
|
||||
|
||||
@@ -1723,8 +1723,8 @@ impl MainSplitData {
|
||||
let splits = self.splits.get_untracked();
|
||||
let split = splits.get(&split_id).copied()?;
|
||||
|
||||
let split_chilren = split.with_untracked(|split| split.children.clone());
|
||||
let content = split_chilren.first()?;
|
||||
let split_children = split.with_untracked(|split| split.children.clone());
|
||||
let content = split_children.first()?;
|
||||
self.split_content_focus(&content.1);
|
||||
|
||||
Some(())
|
||||
|
||||
@@ -88,7 +88,7 @@ fn file_view(
|
||||
internal_command: Listener<InternalCommand>,
|
||||
config: ReadSignal<Arc<LapceConfig>>,
|
||||
) -> impl View {
|
||||
let collpased = create_rw_signal(false);
|
||||
let collapsed = create_rw_signal(false);
|
||||
|
||||
let diagnostics = create_rw_signal(im::Vector::new());
|
||||
create_effect(move |_| {
|
||||
@@ -180,7 +180,7 @@ fn file_view(
|
||||
.style(move |s| s.width_pct(100.0).min_width(0.0)),
|
||||
)
|
||||
.on_click_stop(move |_| {
|
||||
collpased.update(|collpased| *collpased = !*collpased);
|
||||
collapsed.update(|collapsed| *collapsed = !*collapsed);
|
||||
})
|
||||
.style(move |s| {
|
||||
let config = config.get();
|
||||
@@ -196,7 +196,7 @@ fn file_view(
|
||||
}),
|
||||
stack((
|
||||
svg(move || {
|
||||
config.get().ui_svg(if collpased.get() {
|
||||
config.get().ui_svg(if collapsed.get() {
|
||||
LapceIcons::ITEM_CLOSED
|
||||
} else {
|
||||
LapceIcons::ITEM_OPENED
|
||||
@@ -224,7 +224,7 @@ fn file_view(
|
||||
.style(move |s| s.width_pct(100.0).min_width(0.0)),
|
||||
dyn_stack(
|
||||
move || {
|
||||
if collpased.get() {
|
||||
if collapsed.get() {
|
||||
im::Vector::new()
|
||||
} else {
|
||||
diagnostics.get()
|
||||
|
||||
@@ -447,7 +447,7 @@ pub fn panel_container_view(
|
||||
.border_color(config.color(LapceColor::LAPCE_BORDER))
|
||||
.color(config.color(LapceColor::PANEL_FOREGROUND))
|
||||
})
|
||||
.debug_name(format!("{:?} Pannel Container View", position))
|
||||
.debug_name(format!("{:?} Panel Container View", position))
|
||||
}
|
||||
|
||||
fn panel_view(
|
||||
|
||||
@@ -78,7 +78,7 @@ struct SettingsItem {
|
||||
serde_value: Value,
|
||||
pos: RwSignal<Point>,
|
||||
size: RwSignal<Size>,
|
||||
// this is only the header that give an visual sepeartion between different type of settings
|
||||
// this is only the header that give an visual separation between different type of settings
|
||||
header: bool,
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ pub struct WindowCommonData {
|
||||
pub latest_release: ReadSignal<Arc<Option<ReleaseInfo>>>,
|
||||
pub ime_allowed: RwSignal<bool>,
|
||||
pub cursor_blink_timer: RwSignal<TimerToken>,
|
||||
// the value to be update by curosr blinking
|
||||
// the value to be update by cursor blinking
|
||||
pub hide_cursor: RwSignal<bool>,
|
||||
pub app_view_id: RwSignal<ViewId>,
|
||||
pub extra_plugin_paths: Arc<Vec<PathBuf>>,
|
||||
|
||||
@@ -1496,7 +1496,7 @@ impl WindowTabData {
|
||||
if let Some(editor_data) =
|
||||
self.main_split.active_editor.get_untracked()
|
||||
{
|
||||
editor_data.find_refenrence(self.clone());
|
||||
editor_data.find_reference(self.clone());
|
||||
}
|
||||
}
|
||||
GoToImplementation => {
|
||||
@@ -2018,7 +2018,7 @@ impl WindowTabData {
|
||||
match cmd.wait() {
|
||||
Ok(v) => event!(Level::TRACE, "Process exited with status {v}"),
|
||||
Err(e) => {
|
||||
event!(Level::ERROR, "Proces exited with an error: {e}")
|
||||
event!(Level::ERROR, "Process exited with an error: {e}")
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -2036,7 +2036,7 @@ impl WindowTabData {
|
||||
}
|
||||
})
|
||||
}) else {
|
||||
error!("cound not find terminal tab data: index={tab_index}");
|
||||
error!("could not find terminal tab data: index={tab_index}");
|
||||
return;
|
||||
};
|
||||
let Some(raw) = tab.terminals.with_untracked(|x| {
|
||||
@@ -2048,7 +2048,7 @@ impl WindowTabData {
|
||||
}
|
||||
})
|
||||
}) else {
|
||||
error!("cound not find terminal data: index={terminal_index}");
|
||||
error!("could not find terminal data: index={terminal_index}");
|
||||
return;
|
||||
};
|
||||
raw.write().term.reset_state();
|
||||
|
||||
@@ -561,11 +561,10 @@ const LANGUAGES: &[SyntaxProperties] = &[
|
||||
files: &[],
|
||||
extensions: &[
|
||||
"clj",
|
||||
"edn",
|
||||
"edn", // spellchecker:disable-line
|
||||
"cljs",
|
||||
"cljc",
|
||||
"cljd",
|
||||
"edn",
|
||||
"bb",
|
||||
"clj_kondo",
|
||||
],
|
||||
@@ -850,12 +849,14 @@ const LANGUAGES: &[SyntaxProperties] = &[
|
||||
id: LapceLanguage::Glsl,
|
||||
indent: Indent::space(2),
|
||||
files: &[],
|
||||
// spellchecker:off
|
||||
extensions: &[
|
||||
"glsl", "cs", "vs", "gs", "fs", "csh", "vsh", "gsh", "fsh", "cshader",
|
||||
"vshader", "gshader", "fshader", "comp", "vert", "geom", "frag", "tesc",
|
||||
"tese", "mesh", "task", "rgen", "rint", "rahit", "rchit", "rmiss",
|
||||
"rcall",
|
||||
],
|
||||
// spellchecker:on
|
||||
comment: comment_properties!("//"),
|
||||
tree_sitter: TreeSitterProperties::DEFAULT,
|
||||
},
|
||||
@@ -1884,7 +1885,7 @@ fn load_grammar(
|
||||
if !library_path.exists() {
|
||||
event!(Level::WARN, "Grammar not found at: {library_path:?}");
|
||||
|
||||
// Load backwar compat libraries
|
||||
// Load backward compat libraries
|
||||
library_path = path.join(format!("tree-sitter-{grammar_name}"));
|
||||
library_path.set_extension(std::env::consts::DLL_EXTENSION);
|
||||
|
||||
@@ -2067,7 +2068,7 @@ mod tests {
|
||||
use super::LapceLanguage;
|
||||
|
||||
#[test]
|
||||
fn test_lanaguage_from_path() {
|
||||
fn test_language_from_path() {
|
||||
let l = LapceLanguage::from_path(&PathBuf::new().join("test.rs"));
|
||||
assert_eq!(l, LapceLanguage::Rust);
|
||||
}
|
||||
|
||||
@@ -221,6 +221,7 @@ pub fn language_id_from_path(path: &Path) -> Option<&'static str> {
|
||||
// stop case-sensitive matching
|
||||
ext => match ext.to_lowercase().as_str() {
|
||||
"bat" => "bat",
|
||||
// spellchecker:ignore-next-line
|
||||
"clj" | "cljs" | "cljc" | "edn" => "clojure",
|
||||
"coffee" => "coffeescript",
|
||||
"c" | "h" => "c",
|
||||
|
||||
@@ -34,8 +34,8 @@ pub fn parse_file_line_column(path: &str) -> Result<PathObject, Error> {
|
||||
if let Some(second_rhs) = splits.peek().and_then(|s| s.parse::<usize>().ok())
|
||||
{
|
||||
splits.next();
|
||||
let remaning: Vec<&str> = splits.rev().collect();
|
||||
let path = remaning.join(":");
|
||||
let remaining: Vec<&str> = splits.rev().collect();
|
||||
let path = remaining.join(":");
|
||||
let path = PathBuf::from(path);
|
||||
let path = if let Ok(path) = path.canonicalize() {
|
||||
path
|
||||
@@ -50,8 +50,8 @@ pub fn parse_file_line_column(path: &str) -> Result<PathObject, Error> {
|
||||
}),
|
||||
)
|
||||
} else {
|
||||
let remaning: Vec<&str> = splits.rev().collect();
|
||||
let path = remaning.join(":");
|
||||
let remaining: Vec<&str> = splits.rev().collect();
|
||||
let path = remaining.join(":");
|
||||
let path = PathBuf::from(path);
|
||||
let path = if let Ok(path) = path.canonicalize() {
|
||||
path
|
||||
|
||||
@@ -1106,7 +1106,7 @@ impl ProxyHandler for Dispatcher {
|
||||
proxy_rpc.handle_response(
|
||||
id,
|
||||
result.map(|resp| ProxyResponse::DapVariableResponse {
|
||||
varialbes: resp,
|
||||
variables: resp,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ use serde_json::Value;
|
||||
use super::{
|
||||
PluginCatalogNotification, PluginCatalogRpcHandler,
|
||||
dap::{DapClient, DapRpcHandler, DebuggerData},
|
||||
psp::{ClonableCallback, PluginServerRpc, PluginServerRpcHandler, RpcCallback},
|
||||
psp::{CloneableCallback, PluginServerRpc, PluginServerRpcHandler, RpcCallback},
|
||||
wasi::{load_all_volts, start_volt},
|
||||
};
|
||||
use crate::plugin::{
|
||||
@@ -83,7 +83,7 @@ impl PluginCatalog {
|
||||
language_id: Option<String>,
|
||||
path: Option<PathBuf>,
|
||||
check: bool,
|
||||
f: Box<dyn ClonableCallback<Value, RpcError>>,
|
||||
f: Box<dyn CloneableCallback<Value, RpcError>>,
|
||||
) {
|
||||
if let Some(plugin_id) = plugin_id {
|
||||
if let Some(plugin) = self.plugins.get(&plugin_id) {
|
||||
@@ -179,7 +179,7 @@ impl PluginCatalog {
|
||||
pub fn shutdown_volt(
|
||||
&mut self,
|
||||
volt: VoltInfo,
|
||||
f: Box<dyn ClonableCallback<Value, RpcError>>,
|
||||
f: Box<dyn CloneableCallback<Value, RpcError>>,
|
||||
) {
|
||||
let id = volt.id();
|
||||
for (plugin_id, plugin) in self.plugins.iter() {
|
||||
|
||||
@@ -366,7 +366,7 @@ impl DapClient {
|
||||
}
|
||||
|
||||
// check if the DAP was restared when we received terminated or disconnected
|
||||
// if the DAP doesn't suports terminate request, then we also need to wait for
|
||||
// if the DAP doesn't supports terminate request, then we also need to wait for
|
||||
// disconnected
|
||||
fn check_restart(&mut self) -> Result<()> {
|
||||
if !self.restarted {
|
||||
|
||||
@@ -74,10 +74,10 @@ impl PluginServerHandler for LspClient {
|
||||
|
||||
fn document_supported(
|
||||
&mut self,
|
||||
lanaguage_id: Option<&str>,
|
||||
language_id: Option<&str>,
|
||||
path: Option<&Path>,
|
||||
) -> bool {
|
||||
self.host.document_supported(lanaguage_id, path)
|
||||
self.host.document_supported(language_id, path)
|
||||
}
|
||||
|
||||
fn handle_handler_notification(
|
||||
|
||||
@@ -80,7 +80,7 @@ use tracing::error;
|
||||
use self::{
|
||||
catalog::PluginCatalog,
|
||||
dap::DapRpcHandler,
|
||||
psp::{ClonableCallback, PluginServerRpcHandler, RpcCallback},
|
||||
psp::{CloneableCallback, PluginServerRpcHandler, RpcCallback},
|
||||
wasi::{load_volt, start_volt},
|
||||
};
|
||||
use crate::buffer::language_id_from_path;
|
||||
@@ -97,7 +97,7 @@ pub enum PluginCatalogRpc {
|
||||
language_id: Option<String>,
|
||||
path: Option<PathBuf>,
|
||||
check: bool,
|
||||
f: Box<dyn ClonableCallback<Value, RpcError>>,
|
||||
f: Box<dyn CloneableCallback<Value, RpcError>>,
|
||||
},
|
||||
ServerNotification {
|
||||
plugin_id: Option<PluginId>,
|
||||
@@ -147,7 +147,7 @@ pub enum PluginCatalogRpc {
|
||||
Handler(PluginCatalogNotification),
|
||||
RemoveVolt {
|
||||
volt: VoltInfo,
|
||||
f: Box<dyn ClonableCallback<Value, RpcError>>,
|
||||
f: Box<dyn CloneableCallback<Value, RpcError>>,
|
||||
},
|
||||
Shutdown,
|
||||
}
|
||||
|
||||
@@ -83,13 +83,13 @@ impl<Resp, Error> ResponseHandler<Resp, Error> {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ClonableCallback<Resp, Error>:
|
||||
pub trait CloneableCallback<Resp, Error>:
|
||||
FnOnce(PluginId, Result<Resp, Error>) + Send + DynClone
|
||||
{
|
||||
}
|
||||
|
||||
impl<Resp, Error, F: Send + FnOnce(PluginId, Result<Resp, Error>) + DynClone>
|
||||
ClonableCallback<Resp, Error> for F
|
||||
CloneableCallback<Resp, Error> for F
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1223,7 +1223,7 @@ impl PluginHostHandler {
|
||||
|
||||
pub fn handle_did_change_text_document(
|
||||
&mut self,
|
||||
lanaguage_id: String,
|
||||
language_id: String,
|
||||
document: VersionedTextDocumentIdentifier,
|
||||
delta: RopeDelta,
|
||||
text: Rope,
|
||||
@@ -1286,7 +1286,7 @@ impl PluginHostHandler {
|
||||
self.server_rpc.server_notification(
|
||||
DidChangeTextDocument::METHOD,
|
||||
params,
|
||||
Some(lanaguage_id),
|
||||
Some(language_id),
|
||||
path,
|
||||
false,
|
||||
);
|
||||
|
||||
@@ -528,7 +528,7 @@ pub fn start_volt(
|
||||
let instance = linker.instantiate(&mut store, &module).unwrap();
|
||||
let handle_rpc = instance
|
||||
.get_func(&mut store, "handle_rpc")
|
||||
.ok_or_else(|| anyhow!("can't convet to function"))
|
||||
.ok_or_else(|| anyhow!("can't convert to function"))
|
||||
.unwrap()
|
||||
.typed::<(), ()>(&mut store)
|
||||
.unwrap();
|
||||
|
||||
@@ -104,7 +104,7 @@ fn test_load_volt() {
|
||||
.and_then(|path| path.to_str())
|
||||
.map(ToOwned::to_owned);
|
||||
|
||||
let color_themes_pathes = ["Dark.toml", "Light.toml"]
|
||||
let color_themes_paths = ["Dark.toml", "Light.toml"]
|
||||
.into_iter()
|
||||
.filter_map(|theme| {
|
||||
parent_path
|
||||
@@ -117,7 +117,7 @@ fn test_load_volt() {
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let icon_themes_pathes = ["Dark.svg", "Light.svg"]
|
||||
let icon_themes_paths = ["Dark.svg", "Light.svg"]
|
||||
.into_iter()
|
||||
.filter_map(|theme| {
|
||||
parent_path
|
||||
@@ -141,8 +141,8 @@ fn test_load_volt() {
|
||||
icon: Some("icon.svg".to_string()),
|
||||
repository: Some("https://github.com/lapce".to_string()),
|
||||
wasm: wasm_path,
|
||||
color_themes: Some(color_themes_pathes),
|
||||
icon_themes: Some(icon_themes_pathes),
|
||||
color_themes: Some(color_themes_paths),
|
||||
icon_themes: Some(icon_themes_paths),
|
||||
dir: parent_path.canonicalize().ok(),
|
||||
activation: None,
|
||||
config: None
|
||||
@@ -164,7 +164,7 @@ fn test_load_volt() {
|
||||
.and_then(|path| path.to_str())
|
||||
.map(ToOwned::to_owned);
|
||||
|
||||
let color_themes_pathes = ["Light.toml"]
|
||||
let color_themes_paths = ["Light.toml"]
|
||||
.into_iter()
|
||||
.filter_map(|theme| {
|
||||
parent_path
|
||||
@@ -177,7 +177,7 @@ fn test_load_volt() {
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let icon_themes_pathes = ["Light.svg"]
|
||||
let icon_themes_paths = ["Light.svg"]
|
||||
.into_iter()
|
||||
.filter_map(|theme| {
|
||||
parent_path
|
||||
@@ -201,8 +201,8 @@ fn test_load_volt() {
|
||||
icon: Some("icon.svg".to_string()),
|
||||
repository: Some("https://github.com/lapce".to_string()),
|
||||
wasm: wasm_path,
|
||||
color_themes: Some(color_themes_pathes),
|
||||
icon_themes: Some(icon_themes_pathes),
|
||||
color_themes: Some(color_themes_paths),
|
||||
icon_themes: Some(icon_themes_paths),
|
||||
dir: parent_path.canonicalize().ok(),
|
||||
activation: None,
|
||||
config: None
|
||||
|
||||
@@ -455,7 +455,7 @@ pub enum ProxyResponse {
|
||||
matches: IndexMap<PathBuf, Vec<SearchMatch>>,
|
||||
},
|
||||
DapVariableResponse {
|
||||
varialbes: Vec<dap_types::Variable>,
|
||||
variables: Vec<dap_types::Variable>,
|
||||
},
|
||||
DapGetScopesResponse {
|
||||
scopes: Vec<(dap_types::Scope, Vec<dap_types::Variable>)>,
|
||||
|
||||
Reference in New Issue
Block a user