Skip to content
Closed
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
620 changes: 310 additions & 310 deletions Common/Tests/Utilities.UI/UI/InteractiveWindow.cs

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions Nodejs/Product/Nodejs/BaseNodeProjectFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudioTools.Project;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
using SR = Microsoft.NodejsTools.Project.SR;

namespace Microsoft.NodejsTools {
[Guid(Guids.NodejsBaseProjectFactoryString)]
Expand Down Expand Up @@ -51,7 +50,7 @@ protected override void UpgradeProject(ref ProjectRootElement projectXml, ref Pr
var globals = projectXml.PropertyGroups.FirstOrDefault() ?? projectXml.AddPropertyGroup();
AddOrSetProperty(globals, NodejsConstants.Environment, envVarsProp.Value.Replace(";", "\r\n"));
envVarsProp.Parent.RemoveChild(envVarsProp);
log(__VSUL_ERRORLEVEL.VSUL_INFORMATIONAL, SR.GetString(SR.UpgradedEnvironmentVariables));
log(__VSUL_ERRORLEVEL.VSUL_INFORMATIONAL, Resources.UpgradedEnvironmentVariables);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
using System.Threading.Tasks;
using Microsoft.NodejsTools.Debugger.Commands;
using Microsoft.NodejsTools.Debugger.Events;
using Microsoft.NodejsTools.Project;
using Microsoft.VisualStudioTools.Project;
using Newtonsoft.Json.Linq;
using SR = Microsoft.NodejsTools.Project.SR;

namespace Microsoft.NodejsTools.Debugger.Communication {
sealed class DebuggerClient : IDebuggerClient {
Expand Down Expand Up @@ -103,7 +103,7 @@ public static async void RunWithRequestExceptionsHandled(Func<Task> action) {
private void OnConnectionClosed(object sender, EventArgs e) {
ConcurrentDictionary<int, TaskCompletionSource<JObject>> messages = Interlocked.Exchange(ref _messages, new ConcurrentDictionary<int, TaskCompletionSource<JObject>>());
foreach (var kv in messages) {
var exception = new IOException(SR.GetString(SR.DebuggerConnectionClosed));
var exception = new IOException(Resources.DebuggerConnectionClosed);
kv.Value.SetException(exception);
}

Expand Down
5 changes: 2 additions & 3 deletions Nodejs/Product/Nodejs/Debugger/DebugEngine/AD7Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudioTools.Project;
using SR = Microsoft.NodejsTools.Project.SR;

namespace Microsoft.NodejsTools.Debugger.DebugEngine {
// AD7Engine is the primary entrypoint object for the debugging engine.
Expand Down Expand Up @@ -1233,15 +1232,15 @@ private void OnDocumentSaved(Document document) {
if (String.Equals(Path.GetExtension(module.FileName), NodejsConstants.TypeScriptExtension, StringComparison.OrdinalIgnoreCase)) {
if (document.ProjectItem.ContainingProject.GetNodeProject().Build(null, null) != MSBuildResult.Successful) {
var statusBar = (IVsStatusbar)ServiceProvider.GlobalProvider.GetService(typeof(SVsStatusbar));
statusBar.SetText(SR.GetString(SR.DebuggerModuleUpdateFailed));
statusBar.SetText(Resources.DebuggerModuleUpdateFailed);
return;
}
}

DebuggerClient.RunWithRequestExceptionsHandled(async () => {
if (!await Process.UpdateModuleSourceAsync(module).ConfigureAwait(false)) {
var statusBar = (IVsStatusbar)ServiceProvider.GlobalProvider.GetService(typeof(SVsStatusbar));
statusBar.SetText(SR.GetString(SR.DebuggerModuleUpdateFailed));
statusBar.SetText(Resources.DebuggerModuleUpdateFailed);
}
});
}
Expand Down
10 changes: 5 additions & 5 deletions Nodejs/Product/Nodejs/Intellisense/AnalysisQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,21 @@ private void Worker(object threadStarted) {
int count = _analyzer._jsAnalyzer.GetAndClearAnalysisCount();
if (count != 0) {
var elapsedTime = TimeSpan.FromMilliseconds(watch.ElapsedMilliseconds - startTime);
statsMessage = SR.GetString(SR.StatusAnalysisUpToDate, count, FormatTime(elapsedTime));
statsMessage = String.Format(Resources.StatusAnalysisUpToDate, count, FormatTime(elapsedTime));
}
}

if (_analyzer._saveToDisk && analyzedAnything && (DateTime.Now - _lastSave) > _SaveAnalysisTime) {
var statusbar = (IVsStatusbar)NodejsPackage.GetGlobalService(typeof(SVsStatusbar));
if (statusbar != null) {
statusbar.SetText(SR.GetString(SR.StatusAnalysisSaving) + " " + statsMessage);
statusbar.SetText(Resources.StatusAnalysisSaving + " " + statsMessage);
}

_analyzer.SaveAnalysis();
_lastSave = DateTime.Now;

if (statusbar != null) {
statusbar.SetText(SR.GetString(SR.StatusAnalysisSaved) + " " + statsMessage);
statusbar.SetText(Resources.StatusAnalysisSaved + " " + statsMessage);
}
} else if(statsMessage != null) {
var statusbar = (IVsStatusbar)NodejsPackage.GetGlobalService(typeof(SVsStatusbar));
Expand All @@ -224,9 +224,9 @@ private void Worker(object threadStarted) {

private static string FormatTime(TimeSpan elapsedTime) {
if (elapsedTime.TotalMilliseconds < 1000) {
return elapsedTime.TotalMilliseconds + " " + SR.GetString(SR.Milliseconds);
return elapsedTime.TotalMilliseconds + " " + Resources.Milliseconds;
} else if (elapsedTime.TotalSeconds < 60) {
return elapsedTime.TotalSeconds + " " + SR.GetString(SR.Seconds);
return elapsedTime.TotalSeconds + " " + Resources.Seconds;
}
return elapsedTime.ToString("g");
}
Expand Down
4 changes: 2 additions & 2 deletions Nodejs/Product/Nodejs/Intellisense/IntellisenseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,10 @@ private void TriggerSnippet(uint nCmdID) {
string prompt;
string[] snippetTypes;
if ((VSConstants.VSStd2KCmdID)nCmdID == VSConstants.VSStd2KCmdID.SURROUNDWITH) {
prompt = SR.GetString(SR.SurroundWith);
prompt = Resources.SurroundWith;
snippetTypes = _surroundsWithSnippetTypes;
} else {
prompt = SR.GetString(SR.InsertSnippet);
prompt = Resources.InsertSnippet;
snippetTypes = _allStandardSnippetTypes;
}

Expand Down
12 changes: 6 additions & 6 deletions Nodejs/Product/Nodejs/Intellisense/VsProjectAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
using Microsoft.NodejsTools.Classifier;
using Microsoft.NodejsTools.Options;
using Microsoft.NodejsTools.Parsing;
using Microsoft.NodejsTools.Project;
using Microsoft.NodejsTools.Repl;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Adornments;
using Microsoft.VisualStudioTools;
using Microsoft.Win32;
using SR = Microsoft.NodejsTools.Project.SR;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.NodejsTools.Intellisense {
Expand Down Expand Up @@ -1349,7 +1349,7 @@ private bool LoadCachedAnalysis(AnalysisLimits limits) {
if (DbHeader.SequenceEqual(header)) {
var statusbar = (IVsStatusbar)NodejsPackage.GetGlobalService(typeof(SVsStatusbar));
if (statusbar != null) {
statusbar.SetText(SR.GetString(SR.StatusAnalysisLoading));
statusbar.SetText(Resources.StatusAnalysisLoading);
}

Task.Run(() => {
Expand All @@ -1369,20 +1369,20 @@ private bool LoadCachedAnalysis(AnalysisLimits limits) {
_jsAnalyzer = analyzer;

if (statusbar != null) {
statusbar.SetText(SR.GetString(SR.StatusAnalysisLoaded));
statusbar.SetText(Resources.StatusAnalysisLoaded);
}
}
}
} catch (InvalidOperationException) {
// corrupt or invalid DB
if (statusbar != null) {
statusbar.SetText(SR.GetString(SR.StatusAnalysisLoadFailed));
statusbar.SetText(Resources.StatusAnalysisLoadFailed);
}
} catch (Exception e) {
Debug.Fail(String.Format("Unexpected exception while loading analysis: {0}", e));
// bug in deserialization
if (statusbar != null) {
statusbar.SetText(SR.GetString(SR.StatusAnalysisLoadFailed));
statusbar.SetText(Resources.StatusAnalysisLoadFailed);
}
} finally {
stream.Dispose();
Expand All @@ -1401,7 +1401,7 @@ private bool LoadCachedAnalysis(AnalysisLimits limits) {
}
}
}
}).HandleAllExceptions(SR.GetString(SR.NodejsToolsForVisualStudio)).DoNotWait();
}).HandleAllExceptions(Resources.NodejsToolsForVisualStudio).DoNotWait();
disposeStream = false;
return true;
}
Expand Down
1 change: 1 addition & 0 deletions Nodejs/Product/Nodejs/Jade/IdleTimeAsyncTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.NodejsTools.Project;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudioTools;
using Microsoft.VisualStudioTools.Project;
Expand Down
4 changes: 2 additions & 2 deletions Nodejs/Product/Nodejs/Nodejs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static string GetPathToNodeExecutableFromEnvironment(string executable =
#if !NO_WINDOWS
public static void ShowNodejsNotInstalled() {
MessageBox.Show(
SR.GetString(SR.NodejsNotInstalled),
Resources.NodejsNotInstalled,
SR.ProductName,
MessageBoxButtons.OK,
MessageBoxIcon.Error
Expand All @@ -129,7 +129,7 @@ public static void ShowNodejsNotInstalled() {

public static void ShowNodejsPathNotFound(string path) {
MessageBox.Show(
SR.GetString(SR.NodeExeDoesntExist, path),
string.Format(Resources.NodeExeDoesntExist, path),
SR.ProductName,
MessageBoxButtons.OK,
MessageBoxIcon.Error
Expand Down
7 changes: 7 additions & 0 deletions Nodejs/Product/Nodejs/Nodejs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,11 @@
<Compile Include="Debugger\Communication\TcpNetworkClient.cs" />
<Compile Include="Debugger\ExceptionHitTreatment.cs" />
<Compile Include="Debugger\ExceptionHandler.cs" />
<Compile Include="Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="SourceMapping\FunctionInfo.cs" />
<Compile Include="SourceMapping\JavaScriptSourceMapInfo.cs" />
<Compile Include="Debugger\NodeConstants.cs" />
Expand Down Expand Up @@ -1659,6 +1664,8 @@
<ManifestResourceName>Microsoft.NodejsTools.Resources</ManifestResourceName>
<Visible>true</Visible>
<SubType>Designer</SubType>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
Expand Down
22 changes: 11 additions & 11 deletions Nodejs/Product/Nodejs/NpmUI/LastRefreshedMessageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ namespace Microsoft.NodejsTools.NpmUI {
internal class LastRefreshedMessageProvider {
public static readonly LastRefreshedMessageProvider RefreshFailed = new LastRefreshedMessageProvider {
Days = int.MaxValue,
Description = SR.GetString(SR.PackageCatalogRefreshFailed)
Description = Resources.PackageCatalogRefreshFailed
};

public static readonly LastRefreshedMessageProvider RefreshInProgress = new LastRefreshedMessageProvider {
Days = 0,
Description = SR.GetString(SR.PackageCatalogRefreshing)
Description = Resources.PackageCatalogRefreshing
};

public static readonly LastRefreshedMessageProvider NpmNotFound = new LastRefreshedMessageProvider {
Expand All @@ -39,25 +39,25 @@ private LastRefreshedMessageProvider() { }
public LastRefreshedMessageProvider(DateTime lastRefreshTime) {
if (lastRefreshTime == DateTime.MinValue) {
Days = int.MaxValue;
Description = SR.GetString(SR.PackageCatalogRefreshFailed);
Description = Resources.PackageCatalogRefreshFailed;
} else {
Days = (int)(DateTime.Now.Date - lastRefreshTime.Date).TotalDays;
if (Days == 0) {
Description = SR.GetString(SR.PackageCatalogRefresh0Days, lastRefreshTime);
Description = string.Format(Resources.PackageCatalogRefresh0Days, lastRefreshTime);
} else if (Days == 1) {
Description = SR.GetString(SR.PackageCatalogRefresh1Day, lastRefreshTime);
Description = string.Format(Resources.PackageCatalogRefresh1Day, lastRefreshTime);
} else if (Days <= 7) {
Description = SR.GetString(SR.PackageCatalogRefresh2To7Days, Days);
Description = string.Format(Resources.PackageCatalogRefresh2To7Days, Days);
} else if (Days <= 14) {
Description = SR.GetString(SR.PackageCatalogRefresh1Week);
Description = Resources.PackageCatalogRefresh1Week;
} else if (Days <= 21) {
Description = SR.GetString(SR.PackageCatalogRefresh2Weeks);
Description = Resources.PackageCatalogRefresh2Weeks;
} else if (Days <= 31) {
Description = SR.GetString(SR.PackageCatalogRefresh3Weeks);
Description = Resources.PackageCatalogRefresh3Weeks;
} else if (Days <= 92) {
Description = SR.GetString(SR.PackageCatalogRefresh1Month);
Description = Resources.PackageCatalogRefresh1Month;
} else {
Description = SR.GetString(SR.PackageCatalogRefresh3Months);
Description = Resources.PackageCatalogRefresh3Months;
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions Nodejs/Product/Nodejs/NpmUI/NpmOutputViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public NpmOutputViewModel(INpmController controller) {
style.Setters.Add(new Setter(Block.MarginProperty, new Thickness(0)));
_output.Resources.Add(typeof(Paragraph), style);

_statusText = SR.GetString(SR.NpmStatusReady);
_statusText = Resources.NpmStatusReady;

_worker = new Thread(Run);
_worker.Name = "npm UI Execution";
Expand Down Expand Up @@ -317,21 +317,21 @@ private void UpdateStatusMessage() {
if (executingCommand && null != command) {
var commandText = command.ToString();
if (count > 0) {
status = SR.GetString(
WithErrors ? SR.NpmStatusExecutingQueuedErrors : SR.NpmStatusExecutingQueued,
status = string.Format(
WithErrors ? Resources.NpmStatusExecutingQueuedErrors : Resources.NpmStatusExecutingQueued,
commandText,
count,
errorsInfo
);
} else {
status = SR.GetString(
WithErrors ? SR.NpmStatusExecutingErrors : SR.NpmStatusExecuting,
status = string.Format(
WithErrors ? Resources.NpmStatusExecutingErrors : Resources.NpmStatusExecuting,
commandText,
errorsInfo
);
}
} else {
status = SR.GetString(WithErrors ? SR.NpmStatusReadyWithErrors : SR.NpmStatusReady, errorsInfo);
status = string.Format(WithErrors ? Resources.NpmStatusReadyWithErrors : Resources.NpmStatusReady, errorsInfo);
}

StatusText = status;
Expand Down
2 changes: 1 addition & 1 deletion Nodejs/Product/Nodejs/NpmUI/NpmPackageInstallViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private async void LoadCatalog(bool forceRefresh) {

CatalogControlVisibility = Visibility.Collapsed;
LoadingCatalogControlVisibility = Visibility.Visible;
LoadingCatalogMessage = SR.GetString(SR.CatalogLoadingDefault);
LoadingCatalogMessage = Resources.CatalogLoadingDefault;

LastRefreshedMessage = LastRefreshedMessageProvider.RefreshInProgress;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public ReadOnlyPackageCatalogEntryViewModel(IPackage package, IPackage localInst
package.Homepages,
(package.Keywords != null && package.Keywords.Any())
? string.Join(", ", package.Keywords)
: SR.GetString(SR.NoKeywordsInPackage),
: Resources.NoKeywordsInPackage,
localInstall != null ? (SemverVersion?)localInstall.Version : null,
globalInstall != null ? (SemverVersion?)globalInstall.Version : null
) {
Expand Down
Loading