New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci(language-service): enable language service tests in bazel #23001
Conversation
You can preview b920e9d at https://pr23001-b920e9d.ngbuilds.io/. |
b920e9d
to
6e63233
Compare
You can preview 6e63233 at https://pr23001-6e63233.ngbuilds.io/. |
@@ -512,6 +512,9 @@ class PipesTable implements SymbolTable { | |||
values(): Symbol[] { return this.pipes.map(pipe => new PipeSymbol(pipe, this.context)); } | |||
} | |||
|
|||
// This matches .d.ts files that look like ".../<package-name>/<package-name>.d.ts", | |||
const INDEX_PATTERN = /[\\|/](\w+)[\\|/]\1\.d\.ts$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
funny thing: you do not match package-name
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/(?:\\|/)(\w+)(?:\\|/)\1\.d\.ts$/;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what you are asking. I need to match /foo/foo.d.ts
but not /foo/bar.d.ts
.
if (isInBazel()) { | ||
const support = setup(); | ||
this.angularPath = path.join(support.basePath, 'node_modules/@angular'); | ||
this.nodeModulesPath = path.join(support.basePath, 'node_modules'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compute the second one first and .join('@angular')
?
this.angularPath = path.join(support.basePath, 'node_modules/@angular'); | ||
this.nodeModulesPath = path.join(support.basePath, 'node_modules'); | ||
} else { | ||
let angularIndex = moduleFilename.indexOf('@angular'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
if (angularIndex >= 0) | ||
this.angularPath = | ||
moduleFilename.substr(0, angularIndex).replace('/all/', '/all/@angular/'); | ||
let distIndex = moduleFilename.indexOf('/dist/all'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
const p = type.filePath as string; | ||
const m = p.match(INDEX_PATTERN); | ||
if (m) { | ||
const indexVersion = path.join(p.substr(0, m.index ! + m[1].length + 1), 'index.d.ts'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find path.join(path.basename(p) + 'index.d.ts';
easier to understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INDEX_PATTERN
should be improved
You can preview 04cc32a at https://pr23001-04cc32a.ngbuilds.io/. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Tests for
@angular/language-service
only run intest.sh
.What is the new behavior?
Tests for
@angular/language-service
inbazel test
.Does this PR introduce a breaking change?