monaco.d.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. declare module monaco.languages.json {
  6. export interface DiagnosticsOptions {
  7. /**
  8. * If set, the validator will be enabled and perform syntax validation as well as schema based validation.
  9. */
  10. readonly validate?: boolean;
  11. /**
  12. * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments.
  13. */
  14. readonly allowComments?: boolean;
  15. /**
  16. * A list of known schemas and/or associations of schemas to file names.
  17. */
  18. readonly schemas?: {
  19. /**
  20. * The URI of the schema, which is also the identifier of the schema.
  21. */
  22. readonly uri: string;
  23. /**
  24. * A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json'
  25. */
  26. readonly fileMatch?: string[];
  27. /**
  28. * The schema for the given URI.
  29. */
  30. readonly schema?: any;
  31. }[];
  32. /**
  33. * If set, the schema service would load schema content on-demand with 'fetch' if available
  34. */
  35. readonly enableSchemaRequest?: boolean;
  36. }
  37. export interface ModeConfiguration {
  38. /**
  39. * Defines whether the built-in documentFormattingEdit provider is enabled.
  40. */
  41. readonly documentFormattingEdits?: boolean;
  42. /**
  43. * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
  44. */
  45. readonly documentRangeFormattingEdits?: boolean;
  46. /**
  47. * Defines whether the built-in completionItemProvider is enabled.
  48. */
  49. readonly completionItems?: boolean;
  50. /**
  51. * Defines whether the built-in hoverProvider is enabled.
  52. */
  53. readonly hovers?: boolean;
  54. /**
  55. * Defines whether the built-in documentSymbolProvider is enabled.
  56. */
  57. readonly documentSymbols?: boolean;
  58. /**
  59. * Defines whether the built-in tokens provider is enabled.
  60. */
  61. readonly tokens?: boolean;
  62. /**
  63. * Defines whether the built-in color provider is enabled.
  64. */
  65. readonly colors?: boolean;
  66. /**
  67. * Defines whether the built-in foldingRange provider is enabled.
  68. */
  69. readonly foldingRanges?: boolean;
  70. /**
  71. * Defines whether the built-in diagnostic provider is enabled.
  72. */
  73. readonly diagnostics?: boolean;
  74. }
  75. export interface LanguageServiceDefaults {
  76. readonly onDidChange: IEvent<LanguageServiceDefaults>;
  77. readonly diagnosticsOptions: DiagnosticsOptions;
  78. readonly modeConfiguration: ModeConfiguration;
  79. setDiagnosticsOptions(options: DiagnosticsOptions): void;
  80. setModeConfiguration(modeConfiguration: ModeConfiguration): void;
  81. }
  82. export var jsonDefaults: LanguageServiceDefaults;
  83. }