Merge branch 'main' into multi-server-completions-tailwind
This commit is contained in:
@@ -293,7 +293,7 @@ mod tests {
|
||||
let language = crate::languages::language("c", tree_sitter_c::language(), None).await;
|
||||
|
||||
cx.add_model(|cx| {
|
||||
let mut buffer = Buffer::new(0, "", cx).with_language(language, cx);
|
||||
let mut buffer = Buffer::new(0, cx.model_id() as u64, "").with_language(language, cx);
|
||||
|
||||
// empty function
|
||||
buffer.edit([(0..0, "int main() {}")], None, cx);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name = "C++"
|
||||
path_suffixes = ["cc", "cpp", "h", "hpp"]
|
||||
path_suffixes = ["cc", "cpp", "h", "hpp", "cxx", "hxx", "inl"]
|
||||
line_comment = "// "
|
||||
autoclose_before = ";:.,=}])>"
|
||||
brackets = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name = "JavaScript"
|
||||
path_suffixes = ["js", "jsx", "mjs"]
|
||||
path_suffixes = ["js", "jsx", "mjs", "cjs"]
|
||||
first_line_pattern = '^#!.*\bnode\b'
|
||||
line_comment = "// "
|
||||
autoclose_before = ";:.,=}])>"
|
||||
@@ -13,6 +13,7 @@ brackets = [
|
||||
{ start = "`", end = "`", close = true, newline = false, not_in = ["comment", "string"] },
|
||||
{ start = "/*", end = " */", close = true, newline = false, not_in = ["comment", "string"] },
|
||||
]
|
||||
word_characters = ["$", "#"]
|
||||
scope_opt_in_language_servers = ["tailwindcss-language-server"]
|
||||
|
||||
[overrides.element]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
use async_trait::async_trait;
|
||||
use collections::HashMap;
|
||||
use feature_flags::FeatureFlagAppExt;
|
||||
use futures::{future::BoxFuture, FutureExt, StreamExt};
|
||||
use gpui::AppContext;
|
||||
use language::{LanguageRegistry, LanguageServerName, LspAdapter, LspAdapterDelegate};
|
||||
@@ -9,7 +10,6 @@ use node_runtime::NodeRuntime;
|
||||
use serde_json::json;
|
||||
use settings::{KeymapFile, SettingsJsonSchemaParams, SettingsStore};
|
||||
use smol::fs;
|
||||
use staff_mode::StaffMode;
|
||||
use std::{
|
||||
any::Any,
|
||||
ffi::OsString,
|
||||
@@ -108,7 +108,7 @@ impl LspAdapter for JsonLspAdapter {
|
||||
cx: &mut AppContext,
|
||||
) -> BoxFuture<'static, serde_json::Value> {
|
||||
let action_names = cx.all_action_names().collect::<Vec<_>>();
|
||||
let staff_mode = cx.default_global::<StaffMode>().0;
|
||||
let staff_mode = cx.is_staff();
|
||||
let language_names = &self.languages.language_names();
|
||||
let settings_schema = cx.global::<SettingsStore>().json_schema(
|
||||
&SettingsJsonSchemaParams {
|
||||
|
||||
@@ -93,7 +93,9 @@ impl LspAdapter for PythonLspAdapter {
|
||||
// to allow our own fuzzy score to be used to break ties.
|
||||
//
|
||||
// see https://github.com/microsoft/pyright/blob/95ef4e103b9b2f129c9320427e51b73ea7cf78bd/packages/pyright-internal/src/languageService/completionProvider.ts#LL2873
|
||||
let Some(sort_text) = &mut item.sort_text else { return };
|
||||
let Some(sort_text) = &mut item.sort_text else {
|
||||
return;
|
||||
};
|
||||
let mut parts = sort_text.split('.');
|
||||
let Some(first) = parts.next() else { return };
|
||||
let Some(second) = parts.next() else { return };
|
||||
@@ -212,7 +214,7 @@ mod tests {
|
||||
});
|
||||
|
||||
cx.add_model(|cx| {
|
||||
let mut buffer = Buffer::new(0, "", cx).with_language(language, cx);
|
||||
let mut buffer = Buffer::new(0, cx.model_id() as u64, "").with_language(language, cx);
|
||||
let append = |buffer: &mut Buffer, text: &str, cx: &mut ModelContext<Buffer>| {
|
||||
let ix = buffer.len();
|
||||
buffer.edit([(ix..ix, text)], Some(AutoindentMode::EachLine), cx);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name = "Python"
|
||||
path_suffixes = ["py", "pyi"]
|
||||
path_suffixes = ["py", "pyi", "mpy"]
|
||||
first_line_pattern = '^#!.*\bpython[0-9.]*\b'
|
||||
line_comment = "# "
|
||||
autoclose_before = ";:.,=}])>"
|
||||
|
||||
@@ -478,7 +478,7 @@ mod tests {
|
||||
let language = crate::languages::language("rust", tree_sitter_rust::language(), None).await;
|
||||
|
||||
cx.add_model(|cx| {
|
||||
let mut buffer = Buffer::new(0, "", cx).with_language(language, cx);
|
||||
let mut buffer = Buffer::new(0, cx.model_id() as u64, "").with_language(language, cx);
|
||||
|
||||
// indent between braces
|
||||
buffer.set_text("fn a() {}", cx);
|
||||
|
||||
@@ -12,6 +12,7 @@ brackets = [
|
||||
{ start = "`", end = "`", close = true, newline = false, not_in = ["string"] },
|
||||
{ start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
]
|
||||
word_characters = ["#", "$"]
|
||||
scope_opt_in_language_servers = ["tailwindcss-language-server"]
|
||||
|
||||
[overrides.element]
|
||||
|
||||
@@ -362,8 +362,9 @@ mod tests {
|
||||
"#
|
||||
.unindent();
|
||||
|
||||
let buffer =
|
||||
cx.add_model(|cx| language::Buffer::new(0, text, cx).with_language(language, cx));
|
||||
let buffer = cx.add_model(|cx| {
|
||||
language::Buffer::new(0, cx.model_id() as u64, text).with_language(language, cx)
|
||||
});
|
||||
let outline = buffer.read_with(cx, |buffer, _| buffer.snapshot().outline(None).unwrap());
|
||||
assert_eq!(
|
||||
outline
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name = "TypeScript"
|
||||
path_suffixes = ["ts"]
|
||||
path_suffixes = ["ts", "cts", "d.cts", "d.mts", "mts"]
|
||||
line_comment = "// "
|
||||
autoclose_before = ";:.,=}])>"
|
||||
brackets = [
|
||||
@@ -12,3 +12,4 @@ brackets = [
|
||||
{ start = "`", end = "`", close = true, newline = false, not_in = ["string"] },
|
||||
{ start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
]
|
||||
word_characters = ["#", "$"]
|
||||
|
||||
Reference in New Issue
Block a user