main.js 753 B

123456789101112131415161718192021222324252627282930313233
  1. exports.activate = function () {
  2. for (const nodeType of ['macro_invocation', 'macro_rule']) {
  3. atom.grammars.addInjectionPoint('source.rust', {
  4. type: nodeType,
  5. language() {
  6. return 'rust';
  7. },
  8. content(node) {
  9. return node.lastChild;
  10. },
  11. includeChildren: true,
  12. languageScope: null,
  13. coverShallowerScopes: true
  14. });
  15. }
  16. };
  17. exports.consumeHyperlinkInjection = (hyperlink) => {
  18. hyperlink.addInjectionPoint('source.rust', {
  19. types: [
  20. 'line_comment',
  21. 'block_comment',
  22. 'string_literal',
  23. 'raw_string_literal'
  24. ]
  25. });
  26. };
  27. exports.consumeTodoInjection = (todo) => {
  28. todo.addInjectionPoint('source.rust', {
  29. types: ['line_comment', 'block_comment']
  30. });
  31. };