Skip to content

standard color of function name is ignored when the arguments is on new line #524

@mjbvz

Description

@mjbvz

From @isaklafleur on September 22, 2017 9:1

  • VSCode Version:
  • OS Version:

Steps to Reproduce:

I'm using prettier extension and it recommends to break on to separates lines. VSC don't color the variable name according to function color if the arguments are not on the same line.

Paste this in editor and you will see the standard function variable color does appear on function findAbbreviations, but not on replaceAbbreviationsWithExpansions

const findAbbreviations = (string, arrayOfAbbreviations) => {
  const stringArray = stringSplit(string);
  const abbreviationMatches = [];
  arrayOfAbbreviations.forEach(item => {
    if (stringArray.indexOf(item.abbreviation) >= 0) {
      abbreviationMatches.push({
        abbreviation: item.abbreviation,
        expansion: item.expansion
      });
    }
  });
  return abbreviationMatches;
};

const replaceAbbreviationsWithExpansions = (
  string,
  abbreviations,
  findAbbreviations
) => {
  if (findAbbreviations.length > 0) {
    const abbreviationMatches = findAbbreviations(string, abbreviations);
    let newString = string;
    abbreviationMatches.forEach(item => {
      newString = newString.replace(item.abbreviation, item.expansion);
    });
    return newString;
  } else {
    return string;
  }
};

Reproduces without extensions: Yes/No
Yes

Copied from original issue: microsoft/vscode#34813

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions