Skip to content

Commit

Permalink
feat: Enable importing and completion of .rest, .rsrc and .json
Browse files Browse the repository at this point in the history
… resource extensions (not parsing)
  • Loading branch information
d-biehl committed Jun 14, 2023
1 parent c2b156b commit 3df22dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@
from .namespace import Namespace


RESOURCE_EXTENSIONS = (".resource", ".robot", ".txt", ".tsv", ".rst", ".rest")
RESOURCE_EXTENSIONS = (
{".resource", ".robot", ".txt", ".tsv", ".rst", ".rest", ".json", ".rsrc"}
if get_robot_version() >= (6, 1)
else {".resource", ".robot", ".txt", ".tsv", ".rst", ".rest"}
)
REST_EXTENSIONS = (".rst", ".rest")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,18 @@

ROBOT_FILE_EXTENSION = ".robot"
RESOURCE_FILE_EXTENSION = ".resource"
REST_EXTENSIONS = {".rst", ".rest"}
JSON_EXTENSIONS = {".json", ".rsrc"}

ALLOWED_RESOURCE_FILE_EXTENSIONS = [ROBOT_FILE_EXTENSION, RESOURCE_FILE_EXTENSION]
ALLOWED_VARIABLES_FILE_EXTENSIONS = [".py", ".yml", ".yaml"]
ALLOWED_RESOURCE_FILE_EXTENSIONS = (
{ROBOT_FILE_EXTENSION, RESOURCE_FILE_EXTENSION, *REST_EXTENSIONS, *JSON_EXTENSIONS}
if get_robot_version() >= (6, 1)
else {ROBOT_FILE_EXTENSION, RESOURCE_FILE_EXTENSION, *REST_EXTENSIONS}
)

ALLOWED_VARIABLES_FILE_EXTENSIONS = (
{".py", ".yml", ".yaml", ".json"} if get_robot_version() >= (6, 1) else {".py", ".yml", ".yaml"}
)
ROBOT_DOC_FORMAT = "ROBOT"
REST_DOC_FORMAT = "REST"

Expand Down

0 comments on commit 3df22dd

Please sign in to comment.