mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-16 04:35:45 +02:00
Workaround missing timestamps in includes
This commit is contained in:
parent
7aecc5731f
commit
9cb27b5066
1 changed files with 8 additions and 1 deletions
|
@ -670,11 +670,15 @@ public class IBViewPart extends ViewPart
|
||||||
if (node != null) {
|
if (node != null) {
|
||||||
IWorkbenchPage page= getSite().getPage();
|
IWorkbenchPage page= getSite().getPage();
|
||||||
IBFile ibf= node.getDirectiveFile();
|
IBFile ibf= node.getDirectiveFile();
|
||||||
|
long timestamp= node.getTimestamp();
|
||||||
if (ibf != null) {
|
if (ibf != null) {
|
||||||
IEditorPart editor= null;
|
IEditorPart editor= null;
|
||||||
IPath filebufferKey= null;
|
IPath filebufferKey= null;
|
||||||
IFile f= ibf.getResource();
|
IFile f= ibf.getResource();
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
|
if (timestamp == 0) {
|
||||||
|
timestamp= f.getLocalTimeStamp();
|
||||||
|
}
|
||||||
fLastNavigationNode= node;
|
fLastNavigationNode= node;
|
||||||
try {
|
try {
|
||||||
editor= IDE.openEditor(page, f, false);
|
editor= IDE.openEditor(page, f, false);
|
||||||
|
@ -686,6 +690,9 @@ public class IBViewPart extends ViewPart
|
||||||
else {
|
else {
|
||||||
IPath location= ibf.getLocation();
|
IPath location= ibf.getLocation();
|
||||||
if (location != null) {
|
if (location != null) {
|
||||||
|
if (timestamp == 0) {
|
||||||
|
timestamp= location.toFile().lastModified();
|
||||||
|
}
|
||||||
fLastNavigationNode= node;
|
fLastNavigationNode= node;
|
||||||
ExternalEditorInput ei= new ExternalEditorInput(new FileStorage(null, location));
|
ExternalEditorInput ei= new ExternalEditorInput(new FileStorage(null, location));
|
||||||
try {
|
try {
|
||||||
|
@ -702,7 +709,7 @@ public class IBViewPart extends ViewPart
|
||||||
Position pos= new Position(node.getDirectiveCharacterOffset(),
|
Position pos= new Position(node.getDirectiveCharacterOffset(),
|
||||||
node.getDirectiveName().length() + 2);
|
node.getDirectiveName().length() + 2);
|
||||||
if (filebufferKey != null) {
|
if (filebufferKey != null) {
|
||||||
IPositionConverter pc= CCorePlugin.getPositionTrackerManager().findPositionConverter(filebufferKey, node.getTimestamp());
|
IPositionConverter pc= CCorePlugin.getPositionTrackerManager().findPositionConverter(filebufferKey, timestamp);
|
||||||
if (pc != null) {
|
if (pc != null) {
|
||||||
pos= pc.historicToActual(pos);
|
pos= pc.historicToActual(pos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue