How to use the vscode-languageserver-types.SymbolKind.Method function in vscode-languageserver-types

To help you get started, we’ve selected a few vscode-languageserver-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MaskRay / vscode-ccls / src / semantic.ts View on Github external
private tryFindDecoration(
    symbol: SemanticSymbol
  ): TextEditorDecorationType|undefined {
    const get = (name: string) => {
      if (!this.semanticEnabled.get(name))
        return undefined;
      const decorations = unwrap(this.semanticDecorations.get(name), "semantic");
      return decorations[symbol.id % decorations.length];
    };

    switch (symbol.kind) {
    // Functions
    case SymbolKind.Method:
    case SymbolKind.Constructor:
      return get('memberFunction');
    case SymbolKind.Function:
      return get('function');
    case CclsSymbolKind.StaticMethod:
      return get('staticMemberFunction');

    // Types
    case SymbolKind.Namespace:
      return get('namespace');
    case SymbolKind.Class:
    case SymbolKind.Struct:
    case SymbolKind.Enum:
    case SymbolKind.TypeParameter:
      return get('type');
    case CclsSymbolKind.TypeAlias:
github recca0120 / vscode-phpunit / server / src / phpunit / phpunit.ts View on Github external
private asDocumentSymbol(node: TestNode, uri: string): SymbolInformation {
        return SymbolInformation.create(
            node.name.replace(/.*\\/g, ''),
            node.class === node.name ? SymbolKind.Class : SymbolKind.Method,
            node.range,
            uri
        );
    }
}
github isundaylee / atom-ide-ccls / lib / main.js View on Github external
break;
    case SymbolKind.TypeParameter:
      options.class = 'ccls--type-parameter';
      break;
    case SymbolKind.Function:
      options.class = 'ccls--free-function';
      break;
    case SymbolKind.Method:
      options.class = 'ccls--member-function';
      break;
    case CustomSymbolKind.StaticMethod:
      options.class = 'ccls--static-member-function';
      break;
    case SymbolKind.Variable:
      if (symbol.parentKind == SymbolKind.Function ||
          symbol.parentKind == SymbolKind.Method ||
          symbol.parentKind == SymbolKind.Constructor) {
        options.class = 'ccls--free-variable';
      } else {
        options.class = 'ccls--global-variable';
      }
      break;
    case SymbolKind.Field:
      if (symbol.storage == StorageClass.Static) {
        options.class = 'ccls--static-meber-variable';
      } else {
        options.class = 'ccls--member-variable';

      }
      break;
    case CustomSymbolKind.Parameter:
      options.class = 'ccls--parameter';
github facebookarchive / flow-language-server / src / Symbol.js View on Github external
return items;
}

const OUTLINE_KIND_TO_LSP_KIND = {
  array: SymbolKind.Array,
  boolean: SymbolKind.Boolean,
  class: SymbolKind.Class,
  constant: SymbolKind.Constant,
  constructor: SymbolKind.Constructor,
  enum: SymbolKind.Enum,
  field: SymbolKind.Field,
  file: SymbolKind.File,
  function: SymbolKind.Function,
  interface: SymbolKind.Interface,
  method: SymbolKind.Method,
  module: SymbolKind.Module,
  namespace: SymbolKind.Namespace,
  number: SymbolKind.Number,
  package: SymbolKind.Package,
  property: SymbolKind.Property,
  string: SymbolKind.String,
  variable: SymbolKind.Variable,
};
github vuejs / vetur / server / src / modes / script / javascript.ts View on Github external
case 'local var':
    case 'const':
      return SymbolKind.Variable;
    case 'function':
    case 'local function':
      return SymbolKind.Function;
    case 'enum':
      return SymbolKind.Enum;
    case 'module':
      return SymbolKind.Module;
    case 'class':
      return SymbolKind.Class;
    case 'interface':
      return SymbolKind.Interface;
    case 'method':
      return SymbolKind.Method;
    case 'property':
    case 'getter':
    case 'setter':
      return SymbolKind.Property;
  }
  return SymbolKind.Variable;
}
github neoclide / coc-html / server / modes / javascriptMode.ts View on Github external
case 'local var':
		case 'const':
			return SymbolKind.Variable;
		case 'function':
		case 'local function':
			return SymbolKind.Function;
		case 'enum':
			return SymbolKind.Enum;
		case 'module':
			return SymbolKind.Module;
		case 'class':
			return SymbolKind.Class;
		case 'interface':
			return SymbolKind.Interface;
		case 'method':
			return SymbolKind.Method;
		case 'property':
		case 'getter':
		case 'setter':
			return SymbolKind.Property;
	}
	return SymbolKind.Variable;
}
github sourcegraph / javascript-typescript-langserver / src / symbols.ts View on Github external
case 'enum':
            return SymbolKind.Enum
        case 'enum member':
            return SymbolKind.Constant
        case 'var':
            return SymbolKind.Variable
        case 'local var':
            return SymbolKind.Variable
        case 'function':
            return SymbolKind.Function
        case 'local function':
            return SymbolKind.Function
        case 'method':
            return SymbolKind.Method
        case 'getter':
            return SymbolKind.Method
        case 'setter':
            return SymbolKind.Method
        case 'property':
            return SymbolKind.Property
        case 'constructor':
            return SymbolKind.Constructor
        case 'parameter':
            return SymbolKind.Variable
        case 'type parameter':
            return SymbolKind.Variable
        case 'alias':
            return SymbolKind.Variable
        case 'let':
            return SymbolKind.Variable
        case 'const':
            return SymbolKind.Constant
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / node_modules / vscode-css-languageservice / lib / esm / services / cssNavigation.js View on Github external
if (node instanceof nodes.Selector) {
                entry.name = node.getText();
                locationNode = node.findAParent(nodes.NodeType.Ruleset, nodes.NodeType.ExtendsReference);
                if (locationNode) {
                    entry.location = Location.create(document.uri, getRange(locationNode, document));
                    result.push(entry);
                }
                return false;
            }
            else if (node instanceof nodes.VariableDeclaration) {
                entry.name = node.getName();
                entry.kind = SymbolKind.Variable;
            }
            else if (node instanceof nodes.MixinDeclaration) {
                entry.name = node.getName();
                entry.kind = SymbolKind.Method;
            }
            else if (node instanceof nodes.FunctionDeclaration) {
                entry.name = node.getName();
                entry.kind = SymbolKind.Function;
            }
            else if (node instanceof nodes.Keyframe) {
                entry.name = localize('literal.keyframes', "@keyframes {0}", node.getName());
            }
            else if (node instanceof nodes.FontFace) {
                entry.name = localize('literal.fontface', "@font-face");
            }
            if (entry.name) {
                entry.location = Location.create(document.uri, getRange(locationNode, document));
                result.push(entry);
            }
            return true;
github forcedotcom / salesforcedx-vscode / packages / salesforcedx-visualforce-language-server / src / modes / javascriptMode.ts View on Github external
case 'local var':
    case 'const':
      return SymbolKind.Variable;
    case 'function':
    case 'local function':
      return SymbolKind.Function;
    case 'enum':
      return SymbolKind.Enum;
    case 'module':
      return SymbolKind.Module;
    case 'class':
      return SymbolKind.Class;
    case 'interface':
      return SymbolKind.Interface;
    case 'method':
      return SymbolKind.Method;
    case 'property':
    case 'getter':
    case 'setter':
      return SymbolKind.Property;
  }
  return SymbolKind.Variable;
}