Skip to content
This repository has been archived by the owner on Sep 6, 2020. It is now read-only.

Updated command list and "argument-constants" highlighting to CMake version 3.14 #23

Merged
merged 1 commit into from
May 19, 2019
Merged

Updated command list and "argument-constants" highlighting to CMake version 3.14 #23

merged 1 commit into from
May 19, 2019

Conversation

TrinityCoder
Copy link
Contributor

@TrinityCoder TrinityCoder commented May 18, 2019

1. Intro

Hello, I am a regular user of Atom Editor together with the language-cmake extension. I have noticed that it has not been updated for a while, which means it's syntax highlighting rules are not up to date with current CMake releases.

I have created this pull request containing updated cmake listfile.cson file, specifically the argument-constants array and the command list above. CMake commit 4aace9b0 was used for extraction (version 3.14).

To extract the argument-constants array, I digged an old Ruby script and made few changes to make it working again: arg_separators.rb.

To extract the list of commands, simple cmake --help-command-list was sufficient.

2. Changes

The command list only has several new commands:

add_link_options
include_guard
target_link_directories
target_link_options

However, the argument-constants array has many new entries:

ACTION
AND
ANDROID_MK
ARGC
ARGV
ARGV0
ARGV2
AT
BASE_DIR
BUILD_ID
BUILD_INTERFACE
BUILD_TESTING
CAPTURE_CMAKE_ERROR
CASE
CD
CM
CMAKE_C_EXTENSIONS
CMAKE_C_STANDARD
CMAKE_C_STANDARD_REQUIRED
CMAKE_CUDA_EXTENSIONS
CMAKE_CUDA_STANDARD
CMAKE_CUDA_STANDARD_REQUIRED
CMAKE_CURRENT_BINARY_DIR
CMAKE_CURRENT_SOURCE_DIR
CMAKE_CXX_EXTENSIONS
CMAKE_CXX_STANDARD
CMAKE_CXX_STANDARD_REQUIRED
CMAKE_FIND_PACKAGE_SORT_DIRECTION
CMAKE_FIND_PACKAGE_SORT_ORDER
CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
CMAKE_INSTALL_INCLUDEDIR
CMAKE_MODULE_PATH
CMAKE_PROJECT_HOMEPAGE_URL
CMAKE_PROJECT_VERSION
CMP0017
CMP0067
COMMAND_ECHO
COMMAND_EXPAND_LISTS
CONFIGURE_DEPENDS
COPY_ON_ERROR
CP
CREATE_LINK
CT
CTEST_BINARY_DIRECTORY
CTEST_BUILD_COMMAND
CTEST_SOURCE_DIRECTORY
CTEST_SUBMIT_URL
CVS
CXX
DEC
DECIMAL
DEFECT_COUNT
DEPFILE
DESCRIPTION
ENCODING
ERROR_FILE
ERROR_QUIET
ERROR_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE
EXCLUDE_FIXTURE
EXCLUDE_FIXTURE_CLEANUP
EXCLUDE_FIXTURE_SETUP
EXPORT_ANDROID_MK
FAST
FILTER
FIND_LIBRARY_USE_LIBX32_PATHS
FLAGS
FOR
GNUI
GREATER_EQUAL
GROUP_EXECUTE
GROUP_READ
HASH
HEXADECIMAL
HOMEPAGE_URL
HTTP
HTTPHEADER
ID
IDE
IMPORTED_LOCATION
IMPORTED_NO_SONAME
INPUT_FILE
INSTALL_INTERFACE
INTERNAL
JOIN
LANG
LESS_EQUAL
LINK_OPTIONS
LIST
LIST_DIRECTORIES
MESSAGE
MSVC
MY_INSTALL
NAMELINK_COMPONENT
NATURAL
NO_PACKAGE_ROOT_PATH
OBJ
OBJECTS
OFF
ON
OR
ORDER
OUTPUT_FILE
OUTPUT_FORMAT
OUTPUT_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
OWNER_EXECUTE
OWNER_READ
OWNER_WRITE
PARSE_ARGV
PIES
POP_BACK
POP_FRONT
POST_INSTALL_SCRIPT
PREFIX
PRE_INSTALL_SCRIPT
PREPEND
PROJECT
PROJECT_DESCRIPTION
PROJECT_NAME
READ_SYMLINK
REGULAR_EXPRESSION
REPEAT
RESULTS_VARIABLE
SELECTOR
SHELL
SIZE
STATUS
STRGREATER_EQUAL
STRLESS_EQUAL
SUBLIST
SUBMIT_URL
SYMBOLIC
TARGET_OBJECTS
TEST_LOAD
TOUCH
TOUCH_NOCREATE
TRANSFORM
TREE
TRUE
UNIX_COMMAND
URL
VERSION_GREATER_EQUAL
VERSION_LESS_EQUAL
VS
WIX
WX
W4

There are several identifiers that weren't extracted by the arg_separators.rb script and are therefore removed by my commit:

COMP
DFOO
NNNN
VAR2

3. Conclusion

The majority of listed identifiers looks good to me and I think that many of them deserve to be highlighted. I am currently using this version of grammar file with my language-cmake plugin and I enjoy the result; noticeably more words are now highlighted.

I provide this pull request so that you can try it if you want. I would also appreciate comments related to the identifiers which should / should not be added.

@TrinityCoder TrinityCoder changed the title Updated command list and "argument-constants" Updated command list and "argument-constants" highlighting to CMake version 3.14 May 18, 2019
Grammar file "cmake listfile.cson" updated - specifically,
the command list + the "argument-constants" list updated.

Command list updated using the command:
  cmake --help-command-list

To obtain the current "argument-constants" list, I digged up
the old arg_separators.rb Ruby script and tweaked it up to
make it run with current Ruby:
  https://gist.github.com/TrinityCoder/c1c011f12c54c8ee8a1121bc9c2a21cd
@lucas-clemente lucas-clemente merged commit ed2768a into lucas-clemente:master May 19, 2019
@lucas-clemente
Copy link
Owner

I don't use atom anymore, but still, thank for the PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants