My dotfiles
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

99 linhas
4.4 KiB

  1. import { TextDocument, Position, Range, CompletionList } from 'vscode-languageserver-types';
  2. export interface EmmetConfiguration {
  3. showExpandedAbbreviation?: string;
  4. showAbbreviationSuggestions?: boolean;
  5. syntaxProfiles?: object;
  6. variables?: object;
  7. preferences?: object;
  8. excludeLanguages?: string[];
  9. showSuggestionsAsSnippets?: boolean;
  10. }
  11. export interface ExpandOptions {
  12. field: (index: any, placeholder: any) => string;
  13. syntax: string;
  14. profile: any;
  15. addons: any;
  16. variables: any;
  17. snippets: any;
  18. format: any;
  19. preferences: any;
  20. }
  21. export declare function doComplete(document: TextDocument, position: Position, syntax: string, emmetConfig: EmmetConfiguration): CompletionList;
  22. export declare const emmetSnippetField: (index: any, placeholder: any) => string;
  23. export declare function isStyleSheet(syntax: any): boolean;
  24. /**
  25. * * Extracts abbreviation from the given position in the given document
  26. * @param document The TextDocument from which abbreviation needs to be extracted
  27. * @param position The Position in the given document from where abbreviation needs to be extracted
  28. * @param options The options to pass to the @emmetio/extract-abbreviation module
  29. */
  30. export declare function extractAbbreviation(document: TextDocument, position: Position, options?: boolean | {
  31. lookAhead?: boolean;
  32. syntax?: string;
  33. }): {
  34. abbreviation: string;
  35. abbreviationRange: Range;
  36. filter: string;
  37. };
  38. /**
  39. * Extracts abbreviation from the given text
  40. * @param text Text from which abbreviation needs to be extracted
  41. * @param syntax Syntax used to extract the abbreviation from the given text
  42. */
  43. export declare function extractAbbreviationFromText(text: string, syntax?: string): {
  44. abbreviation: string;
  45. filter: string;
  46. };
  47. /**
  48. * Returns a boolean denoting validity of given abbreviation in the context of given syntax
  49. * Not needed once https://github.com/emmetio/atom-plugin/issues/22 is fixed
  50. * @param syntax string
  51. * @param abbreviation string
  52. */
  53. export declare function isAbbreviationValid(syntax: string, abbreviation: string): boolean;
  54. /**
  55. * Returns options to be used by the @emmetio/expand-abbreviation module
  56. * @param syntax
  57. * @param textToReplace
  58. */
  59. export declare function getExpandOptions(syntax: string, emmetConfig?: object, filter?: string): ExpandOptions;
  60. /**
  61. * Parses given abbreviation using given options and returns a tree
  62. * @param abbreviation string
  63. * @param options options used by the @emmetio/expand-abbreviation module to parse given abbreviation
  64. */
  65. export declare function parseAbbreviation(abbreviation: string, options: ExpandOptions): any;
  66. /**
  67. * Expands given abbreviation using given options
  68. * @param abbreviation string or parsed abbreviation
  69. * @param options options used by the @emmetio/expand-abbreviation module to expand given abbreviation
  70. */
  71. export declare function expandAbbreviation(abbreviation: any, options: ExpandOptions): string;
  72. /**
  73. * Updates customizations from snippets.json and syntaxProfiles.json files in the directory configured in emmet.extensionsPath setting
  74. */
  75. export declare function updateExtensionsPath(emmetExtensionsPath: string, workspaceFolderPath?: string): Promise<void>;
  76. /**
  77. * Get the corresponding emmet mode for given vscode language mode
  78. * Eg: jsx for typescriptreact/javascriptreact or pug for jade
  79. * If the language is not supported by emmet or has been exlcuded via `exlcudeLanguages` setting,
  80. * then nothing is returned
  81. *
  82. * @param language
  83. * @param exlcudedLanguages Array of language ids that user has chosen to exlcude for emmet
  84. */
  85. export declare function getEmmetMode(language: string, excludedLanguages?: string[]): string;
  86. /**
  87. * Returns a completion participant for Emmet of the form {
  88. * onCssProperty: () => void
  89. * onCssPropertyValue: () => void
  90. * onHtmlContent: () => void
  91. * }
  92. * @param document The TextDocument for which completions are being provided
  93. * @param position The Position in the given document where completions are being provided
  94. * @param syntax The Emmet syntax to use when providing Emmet completions
  95. * @param emmetSettings The Emmet settings to use when providing Emmet completions
  96. * @param result The Completion List object that needs to be updated with Emmet completions
  97. */
  98. export declare function getEmmetCompletionParticipants(document: TextDocument, position: Position, syntax: string, emmetSettings: EmmetConfiguration, result: CompletionList): any;