Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const LGPage: React.FC<LGPageProps> = props => {

useEffect(() => {
const activeDialog = dialogs.find(({ id }) => id === fileId);
if (!activeDialog && dialogs.length) {
if (!activeDialog && dialogs.length && fileId !== 'common') {
navigateTo('/language-generation/common');
}
}, [fileId, dialogs]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,30 @@ export default function useNotifications(filter?: string) {
});
lgFiles.forEach(lgFile => {
const lgTemplates = get(lgFile, 'templates', []);
lgFile.diagnostics.map(diagnostic => {
const mappedTemplate = lgTemplates.find(
t =>
get(diagnostic, 'range.start.line') >= get(t, 'range.startLineNumber') &&
get(diagnostic, 'range.end.line') <= get(t, 'range.endLineNumber')
);
let id = lgFile.id;
const location = `${lgFile.id}.lg`;
if (mappedTemplate && mappedTemplate.name.match(LgNamePattern)) {
//should navigate to design page
id = `${lgFile.id}#${mappedTemplate.name}`;
}
notifactions.push({
type: 'lg',
severity: DiagnosticSeverity[diagnostic.severity] || '',
location,
message: createSingleMessage(diagnostic),
diagnostic,
id,
lgFile.diagnostics
// only report diagnostics belong to itself.
.filter(({ source, message }) => message.includes(`source: ${source}`))
.map(diagnostic => {
const mappedTemplate = lgTemplates.find(
t =>
get(diagnostic, 'range.start.line') >= get(t, 'range.startLineNumber') &&
get(diagnostic, 'range.end.line') <= get(t, 'range.endLineNumber')
);
let id = lgFile.id;
const location = `${lgFile.id}.lg`;
if (mappedTemplate && mappedTemplate.name.match(LgNamePattern)) {
//should navigate to design page
id = `${lgFile.id}#${mappedTemplate.name}`;
}
notifactions.push({
type: 'lg',
severity: DiagnosticSeverity[diagnostic.severity] || '',
location,
message: createSingleMessage(diagnostic),
diagnostic,
id,
});
});
});
});
return notifactions;
}, [dialogs, luFiles, lgFiles]);
Expand Down