From 6d92aa841812d64075b7639b5dda46ba013d2984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Andr=C3=A9s=20Margffoy=20Tuay?= Date: Mon, 11 Jan 2021 16:28:01 -0500 Subject: [PATCH] Add STIL to the list of supported languages --- spyder/plugins/completion/manager/api.py | 2 +- spyder/plugins/editor/widgets/codeeditor.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spyder/plugins/completion/manager/api.py b/spyder/plugins/completion/manager/api.py index 7239fcbac9e..996b1512eee 100644 --- a/spyder/plugins/completion/manager/api.py +++ b/spyder/plugins/completion/manager/api.py @@ -194,7 +194,7 @@ def shutdown(self): 'Bash', 'C#', 'Cpp', 'CSS/LESS/SASS', 'Go', 'GraphQL', 'Groovy', 'Elixir', 'Erlang', 'Fortran', 'Haxe', 'HTML', 'Java', 'JavaScript', 'JSON', 'Julia', 'Kotlin', 'OCaml', 'PHP', 'R', 'Rust', 'Scala', 'Swift', - 'TypeScript' + 'TypeScript', 'STIL' ] # -------------------- WORKSPACE CONFIGURATION CONSTANTS ---------------------- diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py index c180c83d46c..78cb5186015 100644 --- a/spyder/plugins/editor/widgets/codeeditor.py +++ b/spyder/plugins/editor/widgets/codeeditor.py @@ -1991,6 +1991,7 @@ def set_highlight_current_cell(self, enable): self.unhighlight_current_cell() def set_language(self, language, filename=None): + extra_supported_languages = {'stil': 'STIL'} self.tab_indents = language in self.TAB_ALWAYS_INDENTS self.comment_string = '' self.language = 'Text' @@ -2025,6 +2026,11 @@ def set_language(self, language, filename=None): self.language = 'R' else: self.language = sh_class._lexer.name + else: + _, ext = osp.splitext(filename) + ext = ext.lower() + if ext in extra_supported_languages: + self.language = extra_supported_languages[ext] self._set_highlighter(sh_class) self.completion_widget.set_language(self.language)