Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Add STIL to the list of supported languages #14576

Merged
merged 1 commit into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spyder/plugins/completion/manager/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ----------------------
Expand Down
6 changes: 6 additions & 0 deletions spyder/plugins/editor/widgets/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down