Skip to content

Commit 51ff4c5

Browse files
enricosadalatkin
authored andcommitted
Remove unused code
Deletes code conditional on unused defines - SINGLE_FILE_GENERATOR - NOT_YET_NEEDED - BETA2 - IMPLEMENT_IVSPERSISTHIERARCHYITEM2 - IVsOutliningCapableLanguage - CUT - DISABLED - OLDCODE - Suggestion4299 - UNUSED_DEPENDENT_FILES - UNUSED_NESTED_PROJECTS - NEVER - false - UNUSED closes dotnet/fsharp#353 commit 2839aab40f4e3ab434f0738d5c8e3691d7c2c5df Author: latkin <[email protected]> Date: Mon Aug 3 17:22:20 2015 -0700 Fix merge conflict commit fc4602bf8b60204d85e707db1438f78cc082cb3d Author: enricosada <[email protected]> Date: Thu Apr 9 18:15:19 2015 +0200 remove SINGLE_FILE_GENERATOR commit 2dc0802e76006c6f5dcceae3360325eba01aea6c Author: enricosada <[email protected]> Date: Thu Apr 9 18:08:21 2015 +0200 remove NOT_YET_NEEDED commit df49b75211747dcd4e0ff887ef4473a280bf4a59 Author: enricosada <[email protected]> Date: Thu Apr 9 18:05:56 2015 +0200 remove BETA2 commit 70858f0689b29638ebfb35e1c3b0aa149895b801 Author: enricosada <[email protected]> Date: Thu Apr 9 18:05:36 2015 +0200 remove IMPLEMENT_IVSPERSISTHIERARCHYITEM2 commit d5ec2047ed550db9396892bfbdea28b07bc46193 Author: enricosada <[email protected]> Date: Thu Apr 9 18:02:21 2015 +0200 remove IVsOutliningCapableLanguage commit 7f78d984171b4ed22da6339c6b799bbd44e743b3 Author: enricosada <[email protected]> Date: Thu Apr 9 17:55:24 2015 +0200 remove CUT commit d781a86012e497dd81fe811250d5efb481c80945 Author: enricosada <[email protected]> Date: Thu Apr 9 17:54:59 2015 +0200 remove DISABLED commit d19d387bd38a0b60e688fe6fa40a24d539d5853d Author: enricosada <[email protected]> Date: Thu Apr 9 17:50:06 2015 +0200 remove OLDCODE commit 1997a739aa040aa06428f2d225f7d8771b27f938 Author: enricosada <[email protected]> Date: Thu Apr 9 17:48:02 2015 +0200 remove Suggestion4299 commit 58cfe73fd9931dfb0276be146dc8d51c04c68c51 Author: enricosada <[email protected]> Date: Thu Apr 9 17:31:29 2015 +0200 remove UNUSED_DEPENDENT_FILES commit 790e49786bb74b1c7a3915ed4b4aaf6243543803 Author: enricosada <[email protected]> Date: Thu Apr 9 17:19:47 2015 +0200 remove UNUSED_NESTED_PROJECTS commit b738f464175e825dad7abdc55ad0e0e20a36545c Author: enricosada <[email protected]> Date: Thu Apr 9 17:01:08 2015 +0200 remove NEVER commit 1f9dea77c2618eeaadec25edced524d51c21b534 Author: enricosada <[email protected]> Date: Thu Apr 9 16:59:43 2015 +0200 remove false commit e43fe145b73c81329c1af18744517bef7deb9da4 Author: enricosada <[email protected]> Date: Thu Apr 9 16:57:27 2015 +0200 remove UNUSED
1 parent 66d4883 commit 51ff4c5

38 files changed

+4
-6274
lines changed

src/fsharp/lib.fs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -341,53 +341,6 @@ type Graph<'Data, 'Id when 'Id : comparison and 'Id : equality>
341341
else List.iter (trace (node.nodeData::path)) node.nodeNeighbours
342342
List.iter (fun node -> trace [] node) nodes
343343

344-
#if OLDCODE
345-
346-
member g.DepthFirstSearch() =
347-
let grey = ref Set.empty
348-
let time = ref 0
349-
let forest = ref []
350-
let backEdges = ref []
351-
let discoveryTimes = ref Map.empty
352-
let finishingTimes = ref Map.empty
353-
nodes |> List.iter (fun n ->
354-
// build a dfsTree for each node in turn
355-
let treeEdges = ref []
356-
let rec visit n1 =
357-
incr time;
358-
grey := Set.add n1.nodeId !grey;
359-
discoveryTimes := Map.add n1.nodeId !time !discoveryTimes;
360-
for n2 in n1.nodeNeighbours do
361-
if not ((!grey).Contains n2.nodeId) then
362-
treeEdges := (n1.nodeId,n2.nodeId) :: !treeEdges;
363-
visit(n2)
364-
else
365-
backEdges := (n1.nodeId,n2.nodeId) :: !backEdges
366-
incr time;
367-
finishingTimes := Map.add n1.nodeId !time !finishingTimes;
368-
()
369-
if not ((!grey).Contains n.nodeId) then
370-
visit(n);
371-
forest := (n.nodeId,!treeEdges) :: !forest);
372-
373-
!forest, !backEdges, (fun n -> (!discoveryTimes).[n]), (fun n -> (!finishingTimes).[n])
374-
375-
376-
// Present strongly connected components, in dependency order
377-
// Each node is assumed to have a self-edge
378-
member g.GetTopologicalSortStronglyConnectedComponents() =
379-
let forest, backEdges, discoveryTimes, finishingTimes = g.DepthFirstSearch()
380-
let nodeIds = List.map (fun n -> n.nodeId) nodes
381-
let nodesInDecreasingFinishingOrder =
382-
List.sortWith (fun n1 n2 -> -(compare (finishingTimes n1) (finishingTimes n2))) nodeIds
383-
let gT = Graph (nodeIdentity, List.map g.GetNodeData nodesInDecreasingFinishingOrder, List.map (fun (x,y) -> (g.GetNodeData y, g.GetNodeData x)) edges)
384-
let forest, backEdges, discoveryTimes, finishingTimes = gT.DepthFirstSearch()
385-
let scc (root,tree) = Set.add root (List.foldBack (fun (n1,n2) acc -> Set.add n1 (Set.add n2 acc)) tree Set.empty)
386-
let sccs = List.rev (List.map scc forest)
387-
List.map (Set.toList >> List.map g.GetNodeData) sccs
388-
#endif
389-
390-
391344
//---------------------------------------------------------------------------
392345
// In some cases we play games where we use 'null' as a more efficient representation
393346
// in F#. The functions below are used to give initial values to mutable fields.

src/fsharp/vs/ServiceDeclarations.fs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -107,35 +107,6 @@ module internal ItemDescriptionsImpl =
107107

108108
// Format the supertypes and other useful information about a type to a buffer
109109
let OutputUsefulTypeInfo _isDeclInfo (_infoReader:InfoReader) _m _denv _os _ty = ()
110-
#if DISABLED
111-
if false then
112-
ErrorScope.ProtectAndDiscard m (fun () ->
113-
let g = infoReader.g
114-
let amap = infoReader.amap
115-
let supertypes =
116-
let supertypes = AllSuperTypesOfType g amap m AllowMultiIntfInstantiations.Yes ty
117-
let supertypes = supertypes |> List.filter (AccessibilityLogic.IsTypeAccessible g AccessibleFromSomewhere)
118-
let supertypes = supertypes |> List.filter (typeEquiv g g.obj_ty >> not)
119-
let selfs,supertypes = supertypes |> List.partition (typeEquiv g ty)
120-
let supertypesC,supertypesI = supertypes |> List.partition (isInterfaceTy g)
121-
let supertypes = selfs @ supertypesC @ supertypesI
122-
supertypes
123-
let supertypeLs,_ = NicePrint.layoutPrettifiedTypes denv supertypes
124-
// Suppress printing supertypes for enums, delegates, exceptions and attributes
125-
if supertypes.Length > 1 // more then self
126-
&& not (isEnumTy g ty)
127-
&& not (isUnionTy g ty)
128-
&& not (isRecdTy g ty)
129-
&& not (isDelegateTy g ty)
130-
&& not (ExistsHeadTypeInEntireHierarchy g amap m ty g.exn_tcr)
131-
&& not (ExistsHeadTypeInEntireHierarchy g amap m ty g.tcref_System_Attribute) then
132-
bprintf os "\n\n";
133-
List.zip supertypes supertypeLs |> List.iter (fun (superty,supertyL) ->
134-
if typeEquiv g superty ty then bprintf os " %s: %a\n" (FSComp.SR.typeInfoType()) bufferL supertyL
135-
elif isClassTy g superty || isInterfaceTy g ty then bprintf os " %s: %a\n" (FSComp.SR.typeInfoInherits()) bufferL supertyL
136-
else bprintf os " %s: %a\n" (FSComp.SR.typeInfoImplements()) bufferL supertyL))
137-
#endif
138-
139110

140111
let rangeOfPropInfo (pinfo:PropInfo) =
141112
match pinfo with

src/utils/sformat.fs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,31 +1159,6 @@ namespace Microsoft.FSharp.Text.StructuredFormat
11591159
// pprinter: leafFormatter
11601160
// --------------------------------------------------------------------
11611161

1162-
#if Suggestion4299
1163-
// See bug 4299. Suppress FSI_dddd+<etc> from fsi printer.
1164-
let fixupForInteractiveFSharpClassesWithNoToString obj (text:string) =
1165-
// Given obj:T.
1166-
// If T is a nested type inside a parent type called FSI_dddd, then it looks like an F# Interactive type.
1167-
// Further, if the .ToString() text starts with "FSI_dddd+T" then it looks like it's the default ToString.
1168-
// A better test: it is default ToString if the MethodInfo.DeclaringType is System.Object.
1169-
// In this case, replace "FSI_dddd+T" by "T".
1170-
// assert(obj <> null)
1171-
let fullName = obj.GetType().FullName // e.g. "FSI_0123+Name"
1172-
let name = obj.GetType().Name // e.g. "Name"
1173-
let T = obj.GetType()
1174-
if text.StartsWith(fullName) then
1175-
// text could be a default .ToString() since it starts with the FullName of the type. More checks...
1176-
if T.IsNested &&
1177-
T.DeclaringType.Name.StartsWith("FSI_") && // Name has "FSI_" which is
1178-
T.DeclaringType.Name.Substring(4) |> Seq.forall System.Char.IsDigit // followed by digits?
1179-
then
1180-
name ^ text.Substring(fullName.Length) // replace fullName by name at start of text
1181-
else
1182-
text
1183-
else
1184-
text
1185-
#endif
1186-
11871162
let leafFormatter (opts:FormatOptions) (obj :obj) =
11881163
match obj with
11891164
| null -> "null"
@@ -1219,10 +1194,6 @@ namespace Microsoft.FSharp.Text.StructuredFormat
12191194
| :? bool as b -> (if b then "true" else "false")
12201195
| :? char as c -> "\'" + formatChar true c + "\'"
12211196
| _ -> try let text = obj.ToString()
1222-
//Suggestion4299. Not yet fixed.
1223-
//#if COMPILER
1224-
// let text = fixupForInteractiveFSharpClassesWithNoToString obj text
1225-
//#endif
12261197
text
12271198
with e ->
12281199
// If a .ToString() call throws an exception, catch it and use the message as the result.

vsintegration/src/Salsa/VsMocks.fs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,39 +1222,6 @@ module internal VsMocks =
12221222
member this.UnadviseFileChange(vscookie) = nothing()
12231223
}
12241224

1225-
#if NOT_YET_NEEDED
1226-
let vsExtensibility3 =
1227-
{ new IVsExtensibility3 with
1228-
member this.GetProperties(pParent, pdispPropObj, ppProperties) = err(__LINE__)
1229-
member this.RunWizardFile(bstrWizFilename, hwndOwner, vContextParams, pResult) = err(__LINE__)
1230-
member this.EnterAutomationFunction() = err(__LINE__)
1231-
member this.ExitAutomationFunction() = err(__LINE__)
1232-
member this.IsInAutomationFunction(pfInAutoFunc) = err(__LINE__)
1233-
member this.GetUserControl( fUserControl) = err(__LINE__)
1234-
member this.SetUserControl( fUserControl) = err(__LINE__)
1235-
member this.SetUserControlUnlatched( fUserControl) = err(__LINE__)
1236-
member this.LockServer( vb) = err(__LINE__)
1237-
member this.GetLockCount( pCount) = err(__LINE__)
1238-
member this.TestForShutdown( fShutdown) = err(__LINE__)
1239-
member this.GetGlobalsObject( extractFrom, ppGlobals) = err(__LINE__)
1240-
member this.GetConfigMgr( pIVsProject, itemid, ppCfgMgr) = err(__LINE__)
1241-
member this.FireMacroReset() = err(__LINE__)
1242-
member this.GetDocumentFromDocCookie( lDocCookie, ppDoc) = err(__LINE__)
1243-
member this.IsMethodDisabled( pGUID, dispid) = err(__LINE__)
1244-
member this. SetSuppressUI( In) = err(__LINE__)
1245-
member this.GetSuppressUI( pOut) = err(__LINE__)
1246-
member this.FireProjectsEvent_ItemAdded( project) = err(__LINE__)
1247-
member this.FireProjectsEvent_ItemRemoved( project) = err(__LINE__)
1248-
member this.FireProjectsEvent_ItemRenamed( project, oldName) = err(__LINE__)
1249-
member this.FireProjectItemsEvent_ItemAdded( projectItem) = err(__LINE__)
1250-
member this.FireProjectItemsEvent_ItemRemoved( projectItem) = err(__LINE__)
1251-
member this.FireProjectItemsEvent_ItemRenamed( projectItem, oldName) = err(__LINE__)
1252-
member this.IsFireCodeModelEventNeeded( vbNeeded) = err(__LINE__)
1253-
member this.RunWizardFileEx( bstrWizFilename, hwndOwner, vContextParams, vCustomParams, pResult) = err(__LINE__)
1254-
member this.FireCodeModelEvent3( dispid, pParent, pElement, changeKind) = err(__LINE__)
1255-
}
1256-
#endif
1257-
12581225
let vsSolution =
12591226
{ new IVsSolution with
12601227
member x.GetProjectEnum(grfEnumFlags, rguidEnumOnlyThisType, ppenum) = err(__LINE__)
@@ -1566,9 +1533,6 @@ module internal VsMocks =
15661533
sp.AddService(typeof<SVsTaskList>, box(vsTaskList()), false)
15671534
sp.AddService(typeof<SVsShellMonitorSelection>, box vsMonitorSelection, false)
15681535
sp.AddService(typeof<SVsFileChangeEx>, box vsFileChangeManager, false)
1569-
#if NOT_YET_NEEDED
1570-
sp.AddService(typeof<EnvDTE.IVsExtensibility>, box vsExtensibility3, false)
1571-
#endif
15721536
sp.AddService(typeof<SVsSolution>, box vsSolution, false)
15731537
sp.AddService(typeof<SVsSolutionBuildManager>, box vsSolutionBuildManager, false)
15741538
sp.AddService(typeof<SVsRunningDocumentTable>, box vsRunningDocumentTable, false)

0 commit comments

Comments
 (0)