Add cuda-cpp lang id, grammar and problem matchers (#119444)

* Adding a language ID for CUDA

* Adding aliases for CUDA C++

* Add problem matcher for cuda-cpp based on nvcc output

* Adding a grammar for cuda-cpp

* Adding a language configuration file for cuda-cpp

* Adding a colorizer test for cuda-cpp

* Update the update-grammars.js to pick up cuda-cpp.tmLanguage.json

* Add cgmanifest entry for cuda grammar

Co-authored-by: Alex Ross <alros@microsoft.com>
This commit is contained in:
Pooya Vakeely
2021-03-30 02:18:48 -07:00
committed by GitHub
parent 3287cedd34
commit 95420b39f2
6 changed files with 32067 additions and 0 deletions

View File

@@ -10,6 +10,8 @@ updateGrammar.update('jeff-hykin/cpp-textmate-grammar', 'syntaxes/c.tmLanguage.j
updateGrammar.update('jeff-hykin/cpp-textmate-grammar', 'syntaxes/cpp.tmLanguage.json', './syntaxes/cpp.tmLanguage.json', undefined, 'master', 'source/languages/cpp/');
updateGrammar.update('jeff-hykin/cpp-textmate-grammar', 'syntaxes/cpp.embedded.macro.tmLanguage.json', './syntaxes/cpp.embedded.macro.tmLanguage.json', undefined, 'master', 'source/languages/cpp/');
updateGrammar.update('NVIDIA/cuda-cpp-grammar', 'syntaxes/cuda-cpp.tmLanguage.json', './syntaxes/cuda-cpp.tmLanguage.json', undefined, 'master');
// `source.c.platform` which is still included by other grammars
updateGrammar.update('textmate/c.tmbundle', 'Syntaxes/Platform.tmLanguage', './syntaxes/platform.tmLanguage.json');

View File

@@ -39,6 +39,19 @@
],
"license": "TextMate Bundle License",
"version": "0.0.0"
},
{
"component": {
"type": "git",
"git": {
"name": "NVIDIA/cuda-cpp-grammar",
"repositoryUrl": "https://github.com/NVIDIA/cuda-cpp-grammar",
"commitHash": "81e88eaec5170aa8585736c63627c73e3589998c"
}
},
"license": "MIT",
"version": "0.0.0",
"description": "The file syntaxes/cuda-cpp.tmLanguage.json was derived from https://github.com/jeff-hykin/cpp-textmate-grammar, which was derived from https://github.com/atom/language-c, which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
}
],
"version": 1

View File

@@ -50,6 +50,17 @@
"cpp"
],
"configuration": "./language-configuration.json"
},
{
"id": "cuda-cpp",
"extensions": [
".cu",
".cuh"
],
"aliases": [
"CUDA C++"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
@@ -71,8 +82,35 @@
{
"scopeName": "source.c.platform",
"path": "./syntaxes/platform.tmLanguage.json"
},
{
"language": "cuda-cpp",
"scopeName": "source.cuda-cpp",
"path": "./syntaxes/cuda-cpp.tmLanguage.json"
}
],
"problemPatterns": [
{
"name": "nvcc-location",
"regexp": "^(.*)\\((\\d+)\\):\\s+(warning|error):\\s+(.*)",
"kind": "location",
"file": 1,
"location": 2,
"severity": 3,
"message": 4
}
],
"problemMatchers": [
{
"name": "nvcc",
"owner": "cuda-cpp",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": "$nvcc-location"
}
],
"snippets": [
{
"language": "c",

File diff suppressed because one or more lines are too long