Skip to content

Commit

Permalink
Merge pull request #78 from Stevendeo/source-format
Browse files Browse the repository at this point in the history
sourceFormat as an enum
  • Loading branch information
nberth authored Oct 26, 2023
2 parents 97f7927 + 42aba2d commit 44edd34
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
19 changes: 18 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,24 @@
"description": "The list of copybooks paths"
},
"sourceFormat": {
"description": "The source format of the code"
"description": "The source format of the code",
"items": "string",
"enum": [
"default",
"gnucobol",
"cobol85",
"cobol2002",
"cobol2014",
"acu",
"bs2000",
"gcos",
"ibm",
"mf",
"mvs",
"realia",
"rm",
"xopen"
]
},
"dialect": {
"description": "The COBOL dialect used"
Expand Down
6 changes: 4 additions & 2 deletions src/lsp/superbol_free_lib/project.ml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ let contributes =
Manifest.PROPERTY.array "copybooks"
~description:"The list of copybooks paths" ;

Manifest.PROPERTY.string "sourceFormat"
~description: "The source format of the code" ;
Manifest.PROPERTY.enum "sourceFormat"
~cases:Cobol_config.DIALECT.all_canonical_names
~description: "The source format of the code"
;

Manifest.PROPERTY.string "dialect"
~description: "The COBOL dialect used" ;
Expand Down
7 changes: 7 additions & 0 deletions src/vscode/vscode-json/manifest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,13 @@ module PROPERTY = struct
Some (`A (List.map (fun s -> `String s) strings)))
~items: (`String "string")

let enum ?default ~cases =
property
~type_:(`String "string")
~enum:cases
?default
~items:(`String "string")

end

type configuration = {
Expand Down

0 comments on commit 44edd34

Please sign in to comment.