MCPcopy Create free account
hub / github.com/antonk52/cssmodules-language-server / getPosition

Function getPosition

src/utils.ts:114–128  ·  view source on GitHub ↗
(
    filePath: string,
    className: string,
    camelCaseConfig: CamelCaseValues,
)

Source from the content-addressed store, hash-verified

112 * Finds the position of the className in filePath
113 */
114export async function getPosition(
115 filePath: string,
116 className: string,
117 camelCaseConfig: CamelCaseValues,
118): Promise<Position | null> {
119 const classDict = await filePathToClassnameDict(
120 filePath,
121 getTransformer(camelCaseConfig),
122 );
123 const target = classDict[`.${className}`];
124
125 return target
126 ? Position.create(target.position.line - 1, target.position.column)
127 : null;
128}
129
130export function getWords(
131 line: string,

Callers 1

provideDefinitionMethod · 0.90

Calls 2

filePathToClassnameDictFunction · 0.85
getTransformerFunction · 0.85

Tested by

no test coverage detected