From eb5ffab1cbc010424aa1764005f71dcd67525dc1 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sun, 15 May 2022 14:41:37 -0400 Subject: fix(lsp): correct positions in some scenarios (#14359) --- cli/lsp/documents.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cli/lsp/documents.rs') diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index 0a383e781..4fb8c428e 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -200,6 +200,13 @@ impl AssetOrDocument { } } + pub fn media_type(&self) -> MediaType { + match self { + AssetOrDocument::Asset(_) => MediaType::TypeScript, // assets are always TypeScript + AssetOrDocument::Document(d) => d.media_type(), + } + } + pub fn get_maybe_dependency( &self, position: &lsp::Position, -- cgit v1.2.3