Skip to content

Commit 87662dd

Browse files
authored
Recognize .resource files as Robot Framework files (#2158)
**Problem** RobotFramework supports `.resource` files, but they aren’t highlighted currently. See documentation: https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#resource-files **Solution** Extend the RobotFramework lexer to detect `.resource` files.
1 parent d917e33 commit 87662dd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/rouge/lexers/robot_framework.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class RobotFramework < RegexLexer
1010
title "Robot Framework"
1111
desc 'Robot Framework is a generic open source automation testing framework (robotframework.org)'
1212

13-
filenames '*.robot'
13+
filenames '*.robot', '*.resource'
1414
mimetypes 'text/x-robot'
1515

1616
def initialize(opts = {})

spec/lexers/robot_framework_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
it 'guesses by filename' do
1010
assert_guess :filename => 'foo.robot'
11+
assert_guess :filename => 'foo.resource'
1112
end
1213

1314
it 'guesses by mimetype' do

0 commit comments

Comments
 (0)