Skip to content

Commit

Permalink
feat(rails): add slim language to rails framework (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmeij committed Apr 7, 2021
1 parent d90b065 commit 99a7124
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/frameworks/ruby-rails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class RubyRailsFramework extends Framework {
languageIds: LanguageId[] = [
'ruby',
'haml',
'slim',
'html.erb',
'js.erb',
'erb',
Expand Down Expand Up @@ -51,7 +52,7 @@ class RubyRailsFramework extends Framework {

scope = scope
// remove file extensions
.replace(/(?:\.html\.erb|\.html\.haml|\.haml)$/, '')
.replace(/(?:\.html\.erb|\.html\.haml|\.html\.slim|\.haml)$/, '')
// map path delimiter to dots
.replace(/(?:\/|\\)/g, '.')
// omit the starting underscore on each file
Expand Down
1 change: 1 addition & 0 deletions src/utils/LanguageId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const LanguageIdExtMap = {
'html.erb': 'erb',
'js.erb': 'erb',
haml: 'haml',
slim: 'slim',
handlebars: 'hbs',
blade: 'php',
svelte: 'svelte',
Expand Down

0 comments on commit 99a7124

Please sign in to comment.